- Phalcon\Session\Adapter\AbstractAdapter
- Phalcon\Session\Adapter\Libmemcached
- Phalcon\Session\Adapter\Noop
- Phalcon\Session\Adapter\Redis
- Phalcon\Session\Adapter\Stream
- Phalcon\Session\Bag
- Phalcon\Session\Exception
- Phalcon\Session\Manager
- Phalcon\Session\ManagerInterface
Abstract Class Phalcon\Session\Adapter\AbstractAdapter
| Namespace | Phalcon\Session\Adapter | | Uses | Phalcon\Storage\Adapter\AdapterInterface, SessionHandlerInterface | | Implements | SessionHandlerInterface |
This file is part of the Phalcon.
(c) Phalcon Team team@phalcon.com
For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
Properties¶
Methods¶
Close Destroy Garbage Collector Open Read WriteClass Phalcon\Session\Adapter\Libmemcached
| Namespace | Phalcon\Session\Adapter | | Uses | Phalcon\Storage\AdapterFactory, Phalcon\Helper\Arr | | Extends | AbstractAdapter |
Phalcon\Session\Adapter\Libmemcached
Methods¶
ConstructorClass Phalcon\Session\Adapter\Noop
| Namespace | Phalcon\Session\Adapter | | Uses | SessionHandlerInterface | | Implements | SessionHandlerInterface |
Phalcon\Session\Adapter\Noop
This is an "empty" or null adapter. It can be used for testing or any other purpose that no session needs to be invoked
<?php
use Phalcon\Session\Manager;
use Phalcon\Session\Adapter\Noop;
$session = new Manager();
$session->setAdapter(new Noop());
Properties¶
/**
* The connection of some adapters
*/
protected connection;
/**
* Session options
*
* @var array
*/
protected options;
/**
* Session prefix
*
* @var string
*/
protected prefix = ;
/**
* Time To Live
*
* @var int
*/
protected ttl = 8600;
Methods¶
Constructor Close Destroy Garbage Collector Open Read Write Helper method to get the name prefixedClass Phalcon\Session\Adapter\Redis
| Namespace | Phalcon\Session\Adapter | | Uses | Phalcon\Storage\AdapterFactory, Phalcon\Helper\Arr | | Extends | AbstractAdapter |
Phalcon\Session\Adapter\Redis
Methods¶
ConstructorClass Phalcon\Session\Adapter\Stream
| Namespace | Phalcon\Session\Adapter | | Uses | Phalcon\Helper\Str, Phalcon\Session\Exception | | Extends | Noop |
Phalcon\Session\Adapter\Stream
This is the file based adapter. It stores sessions in a file based system
<?php
use Phalcon\Session\Manager;
use Phalcon\Session\Adapter\Stream;
$session = new Manager();
$files = new Stream(
[
'savePath' => '/tmp',
]
);
$session->setAdapter($files);
Properties¶
Methods¶
Constructor Ignore the savePath and use local defined pathClass Phalcon\Session\Bag
| Namespace | Phalcon\Session | | Uses | Phalcon\Collection, Phalcon\Di, Phalcon\Di\DiInterface, Phalcon\Di\InjectionAwareInterface | | Extends | Collection | | Implements | InjectionAwareInterface |
Phalcon\Session\Bag
This component helps to separate session data into "namespaces". Working by this way you can easily create groups of session variables into the application
Properties¶
Methods¶
Phalcon\Session\Bag constructor Destroys the session bag Returns the DependencyInjector container Initialize internal array Removes a property from the internal bag Sets a value in the session bag Sets the DependencyInjector containerClass Phalcon\Session\Exception
| Namespace | Phalcon\Session | | Extends | \Phalcon\Exception |
Phalcon\Session\Exception
Exceptions thrown in Phalcon\Session will use this class
Class Phalcon\Session\Manager
| Namespace | Phalcon\Session | | Uses | InvalidArgumentException, RuntimeException, SessionHandlerInterface, Phalcon\Di\AbstractInjectionAware, Phalcon\Di\DiInterface, Phalcon\Helper\Arr | | Extends | AbstractInjectionAware | | Implements | ManagerInterface |
Phalcon\Session\Manager
Session manager class
Properties¶
/**
* @var SessionHandlerInterface|null
*/
private adapter;
/**
* @var string
*/
private name = ;
/**
* @var array
*/
private options;
/**
* @var string
*/
private uniqueId = ;
Methods¶
Manager constructor. Alias: Gets a session variable from an application context Alias: Check whether a session variable is set in an application context Alias: Sets a session variable in an application context Alias: Removes a session variable from an application context Destroy/end a session Check whether the session has been started Gets a session variable from an application context Returns the stored session adapter Returns the session id Returns the name of the session Get internal options Check whether a session variable is set in an application context Regenerates the session id using the adapter. Removes a session variable from an application context Sets a session variable in an application context Set the adapter for the session Set session Id Set the session name. Throw exception if the session has started and do not allow poop names Sets session's options Starts the session (if headers are already sent the session will not be started) Returns the status of the current session.Interface Phalcon\Session\ManagerInterface
| Namespace | Phalcon\Session | | Uses | InvalidArgumentException, RuntimeException, SessionHandlerInterface |
Phalcon\Session
Interface for the Phalcon\Session\Manager
Constants¶
Methods¶
Alias: Gets a session variable from an application context Alias: Check whether a session variable is set in an application context Alias: Sets a session variable in an application context Alias: Removes a session variable from an application context Destroy/end a session Check whether the session has been started Gets a session variable from an application context Returns the stored session adapter Returns the session id Returns the name of the session Get internal options Check whether a session variable is set in an application context Regenerates the session id using the adapter. Removes a session variable from an application context Sets a session variable in an application context Set the adapter for the session Set session Id Set the session name. Throw exception if the session has started and do not allow poop names@throws InvalidArgumentException
Sets session's options Starts the session (if headers are already sent the session will not be started) Returns the status of the current session.