Phalcon session
NOTE
All classes are prefixed with Phalcon
Session\Adapter\AbstractAdapter ¶
-
Namespace
Phalcon\Session\Adapter
-
Uses
Phalcon\Storage\Adapter\AdapterInterface
SessionHandlerInterface
-
Extends
-
Implements
SessionHandlerInterface
Properties¶
Methods¶
Close Destroy Garbage Collector Open Read WriteSession\Adapter\Libmemcached¶
-
Namespace
Phalcon\Session\Adapter
-
Uses
Phalcon\Storage\AdapterFactory
-
Extends
AbstractAdapter
-
Implements
Phalcon\Session\Adapter\Libmemcached
Methods¶
ConstructorSession\Adapter\Noop¶
-
Namespace
Phalcon\Session\Adapter
-
Uses
SessionHandlerInterface
-
Extends
-
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 prefixedSession\Adapter\Redis¶
-
Namespace
Phalcon\Session\Adapter
-
Uses
Phalcon\Storage\AdapterFactory
-
Extends
AbstractAdapter
-
Implements
Phalcon\Session\Adapter\Redis
Methods¶
ConstructorSession\Adapter\Stream¶
-
Namespace
Phalcon\Session\Adapter
-
Uses
Phalcon\Session\Exception
-
Extends
Noop
-
Implements
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 pathSession\Bag¶
-
Namespace
Phalcon\Session
-
Uses
Phalcon\Di\Di
Phalcon\Di\DiInterface
Phalcon\Di\InjectionAwareInterface
Phalcon\Session\ManagerInterface
Phalcon\Collection
-
Extends
Collection
-
Implements
BagInterface
InjectionAwareInterface
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¶
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 containerSession\Exception¶
-
Namespace
Phalcon\Session
-
Uses
-
Extends
\Exception
-
Implements
Phalcon\Session\Exception
Exceptions thrown in Phalcon\Session will use this class
Session\Manager¶
-
Namespace
Phalcon\Session
-
Uses
InvalidArgumentException
Phalcon\Di\AbstractInjectionAware
Phalcon\Di\DiInterface
Phalcon\Helper\Arr\Get
RuntimeException
SessionHandlerInterface
-
Extends
AbstractInjectionAware
-
Implements
ManagerInterface
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.Session\ManagerInterface ¶
-
Namespace
Phalcon\Session
-
Uses
InvalidArgumentException
RuntimeException
SessionHandlerInterface
-
Extends
-
Implements
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.