CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 2.6 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 2.6
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Packages

  • Cake
    • Cache
      • Engine
    • Configure
    • Console
      • Command
        • Task
    • Controller
      • Component
        • Acl
        • Auth
    • Core
    • Error
    • Event
    • I18n
    • Log
      • Engine
    • Model
      • Behavior
      • Datasource
        • Database
        • Session
      • Validator
    • Network
      • Email
      • Http
    • Routing
      • Filter
      • Route
    • TestSuite
      • Coverage
      • Fixture
      • Reporter
    • Utility
    • View
      • Helper

Classes

  • CacheSession
  • DatabaseSession

Interfaces

  • CakeSessionHandlerInterface

Class DatabaseSession

DatabaseSession provides methods to be used with CakeSession.

DatabaseSession implements CakeSessionHandlerInterface
Package: Cake\Model\Datasource\Session
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/Model/Datasource/Session/DatabaseSession.php

Properties summary

  • $_model protected
    Model
    Reference to the model handling the session data
  • $_timeout protected
    integer
    Number of seconds to mark the session as expired

Method Summary

  • __construct() public

    Constructor. Looks at Session configuration information and sets up the session model.

  • close() public
    Method called on close of a database session.
  • destroy() public
    Method called on the destruction of a database session.
  • gc() public
    Helper function called on gc for database sessions.
  • open() public
    Method called on open of a database session.
  • read() public
    Method used to read from a database session.
  • write() public
    Helper function called on write for database sessions.

Method Detail

__construct() public ¶

__construct( )

Constructor. Looks at Session configuration information and sets up the session model.

close() public ¶

close( )

Method called on close of a database session.

Returns
boolean
Success
Implementation of
CakeSessionHandlerInterface::close()

destroy() public ¶

destroy( integer $id )

Method called on the destruction of a database session.

Parameters
integer $id
ID that uniquely identifies session in database
Returns
boolean
True for successful delete, false otherwise.
Implementation of
CakeSessionHandlerInterface::destroy()

gc() public ¶

gc( integer $expires = null )

Helper function called on gc for database sessions.

Parameters
integer $expires optional null
Timestamp (defaults to current time)
Returns
boolean
Success
Implementation of
CakeSessionHandlerInterface::gc()

open() public ¶

open( )

Method called on open of a database session.

Returns
boolean
Success
Implementation of
CakeSessionHandlerInterface::open()

read() public ¶

read( integer|string $id )

Method used to read from a database session.

Parameters
integer|string $id
The key of the value to read
Returns
mixed
The value of the key or false if it does not exist
Implementation of
CakeSessionHandlerInterface::read()

write() public ¶

write( integer $id , mixed $data )

Helper function called on write for database sessions.

Parameters
integer $id
ID that uniquely identifies session in database
mixed $data
The value of the data to be saved.
Returns
boolean
True for successful write, false otherwise.
Implementation of
CakeSessionHandlerInterface::write()

Properties detail

$_model ¶

protected Model

Reference to the model handling the session data

$_timeout ¶

protected integer

Number of seconds to mark the session as expired

OpenHub
Rackspace
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (GitHub)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • Slack
  • Paid Support

Generated using CakePHP API Docs