Session.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Session
- Since
- Preview Release 0.2
- Version
- $Id$
\Zend_Session
- Parent(s)
- \Zend_Session_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties
array $_defaultOptions = array('save_path' => null, 'name' => null, 'save_handler' => null, 'gc_probability' => null, 'gc_divisor' => null, 'gc_maxlifetime' => null, 'serialize_handler' => null, 'cookie_lifetime' => null, 'cookie_path' => null, 'cookie_domain' => null, 'cookie_secure' => null, 'cookie_httponly' => null, 'use_cookies' => null, 'use_only_cookies' => 'on', 'referer_check' => null, 'entropy_file' => null, 'entropy_length' => null, 'cache_limiter' => null, 'cache_expire' => null, 'use_trans_sid' => null, 'bug_compat_42' => null, 'bug_compat_warn' => null, 'hash_function' => null, 'hash_bits_per_character' => null)
array('save_path' => null, 'name' => null, 'save_handler' => null, 'gc_probability' => null, 'gc_divisor' => null, 'gc_maxlifetime' => null, 'serialize_handler' => null, 'cookie_lifetime' => null, 'cookie_path' => null, 'cookie_domain' => null, 'cookie_secure' => null, 'cookie_httponly' => null, 'use_cookies' => null, 'use_only_cookies' => 'on', 'referer_check' => null, 'entropy_file' => null, 'entropy_length' => null, 'cache_limiter' => null, 'cache_expire' => null, 'use_trans_sid' => null, 'bug_compat_42' => null, 'bug_compat_warn' => null, 'hash_function' => null, 'hash_bits_per_character' => null)
Details- Type
- array
bool $_defaultOptionsSet = false
false
Details- Type
- bool
bool $_destroyed = false
false
Details- Type
- bool
array $_localOptions = array('strict' => '_strict', 'remember_me_seconds' => '_rememberMeSeconds', 'throw_startup_exceptions' => '_throwStartupExceptions')
array('strict' => '_strict', 'remember_me_seconds' => '_rememberMeSeconds', 'throw_startup_exceptions' => '_throwStartupExceptions')
Details- Type
- array
int $_regenerateIdState = 0
0
Details- Type
- int
int $_rememberMeSeconds = 1209600
1209600
Details- Type
- int
\Zend_Session_SaveHandler_Interface $_saveHandler = null
null
Detailsbool $_sessionCookieDeleted = false
false
Details- Type
- bool
bool $_sessionStarted = false
false
Details- Type
- bool
bool $_strict = false
false
Details- Type
- bool
bool|\bitset $_throwStartupExceptions = true
true
Details- Type
- bool | \bitset
Methods
_checkId(string $id) : bool
Perform a hash-bits check on the session ID
Name | Type | Description |
---|---|---|
$id | string | Session ID |
Type | Description |
---|---|
bool |
_processStartupMetadataGlobal() : void
_processGlobalMetadata() - this method initizes the sessions GLOBAL metadata, mostly global data expiration calculations.
_processValidators() : void
_processValidator() - internal function that is called in the existence of VALID metadata
Exception | Description |
---|---|
\Zend_Session_Exception |
destroy(bool $remove_cookie = true, bool $readonly = true) : void
destroy() - This is used to destroy session data, and optionally, the session cookie itself
Name | Type | Description |
---|---|---|
$remove_cookie | bool |
|
$readonly | bool |
|
expireSessionCookie() : void
expireSessionCookie() - Sends an expired session id cookie, causing the client to delete the session cookie
forgetMe() : void
forgetMe() - Write a volatile session cookie, removing any persistent cookie that may have existed. The session would end upon, for example, termination of a web browser program.
getIterator() : \ArrayObject
getIterator() - return an iteratable object for use in foreach and the like, this completes the IteratorAggregate interface
Type | Description |
---|---|
\ArrayObject |
Exception | Description |
---|---|
\Zend_Session_Exception |
getOptions(string $optionName = null) : array | string
getOptions()
Name | Type | Description |
---|---|---|
$optionName | string | OPTIONAL |
Type | Description |
---|---|
array | string |
getSaveHandler() : \Zend_Session_SaveHandler_Interface
getSaveHandler() - Get the session Save Handler
Type | Description |
---|---|
\Zend_Session_SaveHandler_Interface |
isDestroyed() : bool
Whether or not session has been destroyed via session_destroy()
Type | Description |
---|---|
bool |
isReadable() : bool
isReadable() - returns a boolean indicating if namespaces can write (use setters)
Type | Description |
---|---|
bool |
isRegenerated() : bool
isRegenerated() - convenience method to determine if session_regenerate_id() has been called during this request by Zend_Session.
Type | Description |
---|---|
bool |
isStarted() : bool
isStarted() - convenience method to determine if the session is already started.
Type | Description |
---|---|
bool |
isWritable() : bool
isWritable() - returns a boolean indicating if namespaces can write (use setters)
Type | Description |
---|---|
bool |
namespaceGet(string $namespace) : array
namespaceGet() - get all variables in a namespace Deprecated: Use getIterator() in Zend_Session_Namespace.
Name | Type | Description |
---|---|---|
$namespace | string |
Type | Description |
---|---|
array |
namespaceIsset(string $namespace) : bool
namespaceIsset() - check to see if a namespace is set
Name | Type | Description |
---|---|---|
$namespace | string |
Type | Description |
---|---|
bool |
namespaceUnset(string $namespace) : void
namespaceUnset() - unset a namespace or a variable within a namespace
Name | Type | Description |
---|---|---|
$namespace | string |
Exception | Description |
---|---|
\Zend_Session_Exception |
regenerateId() : void
regenerateId() - Regenerate the session id. Best practice is to call this after session is started. If called prior to session starting, session id will be regenerated at start time.
Exception | Description |
---|---|
\Zend_Session_Exception |
registerValidator(\Zend_Session_Validator_Interface $validator) : void
registerValidator() - register a validator that will attempt to validate this session for every future request
Name | Type | Description |
---|---|---|
$validator | \Zend_Session_Validator_Interface |
rememberMe(int $seconds = null) : void
rememberMe() - Write a persistent cookie that expires after a number of seconds in the future. If no number of seconds is specified, then this defaults to self::$_rememberMeSeconds. Due to clock errors on end users' systems, large values are recommended to avoid undesirable expiration of session cookies.
Name | Type | Description |
---|---|---|
$seconds | int | OPTIONAL specifies TTL for cookie in seconds from present time |
rememberUntil(int $seconds = 0) : void
rememberUntil() - This method does the work of changing the state of the session cookie and making sure that it gets resent to the browser via regenerateId()
Name | Type | Description |
---|---|---|
$seconds | int |
sessionExists() : bool
sessionExists() - whether or not a session exists for the current request
Type | Description |
---|---|
bool |
setId(string $id) : void
setId() - set an id to a user specified id
Name | Type | Description |
---|---|---|
$id | string |
Exception | Description |
---|---|
\Zend_Session_Exception |
setOptions(array $userOptions = array()) : void
setOptions - set both the class specified
Name | Type | Description |
---|---|---|
$userOptions | array |
|
Exception | Description |
---|---|
\Zend_Session_Exception |
setSaveHandler( $saveHandler) : void
setSaveHandler() - Session Save Handler assignment
Name | Type | Description |
---|---|---|
$saveHandler |
Exception | Description |
---|---|
\Zend_Session_Exception | When the session_set_save_handler call fails |
start(bool | array $options = false) : void
start() - Start the session.
Name | Type | Description |
---|---|---|
$options | bool | array | OPTIONAL Either user supplied options, or flag indicating if start initiated automatically |
Exception | Description |
---|---|
\Zend_Session_Exception |
writeClose(bool $readonly = true) : void
writeClose() - Shutdown the sesssion, close writing and detach $_SESSION from the back-end storage mechanism.
Name | Type | Description |
---|---|---|
$readonly | bool |
|