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
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.3 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.3
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 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

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
      • Exception
      • Session
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class CacheSession

CacheSession provides method for saving sessions into a Cache engine. Used with Session

Namespace: Cake\Network\Session
See: \Cake\Model\Datasource\Session for configuration information.

Property Summary

  • $_options protected
    array

    Options for this session engine

Method Summary

  • __construct() public

    Constructor.

  • close() public

    Method called on close of a database session.

  • destroy() public

    Method called on the destruction of a cache session.

  • gc() public

    Helper function called on gc for cache sessions.

  • open() public

    Method called on open of a database session.

  • read() public

    Method used to read from a cache session.

  • write() public

    Helper function called on write for cache sessions.

Method Detail

__construct() ¶ public

__construct(array $config = [])

Constructor.

Parameters
array $config optional

The configuration to use for this engine It requires the key 'config' which is the name of the Cache config to use for storing the session

Throws
InvalidArgumentException
if the 'config' key is not provided

close() ¶ public

close(): bool

Method called on close of a database session.

Returns
bool

destroy() ¶ public

destroy(int $id): bool

Method called on the destruction of a cache session.

Parameters
int $id

ID that uniquely identifies session in cache

Returns
bool

gc() ¶ public

gc(string $maxlifetime): bool

Helper function called on gc for cache sessions.

Parameters
string $maxlifetime

Sessions that have not updated for the last maxlifetime seconds will be removed.

Returns
bool

open() ¶ public

open(string $savePath, string $name): bool

Method called on open of a database session.

Parameters
string $savePath

The path where to store/retrieve the session.

string $name

The session name.

Returns
bool

read() ¶ public

read(string $id): string

Method used to read from a cache session.

Parameters
string $id

The key of the value to read

Returns
string

write() ¶ public

write(int $id, mixed $data): bool

Helper function called on write for cache sessions.

Parameters
int $id

ID that uniquely identifies session in database

mixed $data

The value of the data to be saved.

Returns
bool

Property Detail

$_options ¶ protected

Options for this session engine

Type
array
OpenHub
Pingping
Linode
  • 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
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs