Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Attributes

Zend_Session Class Reference

Static Public Member Functions

static setOptions (array $userOptions=array())
static getOptions ($optionName=null)
static setSaveHandler (Zend_Session_SaveHandler_Interface $saveHandler)
static getSaveHandler ()
static regenerateId ()
static rememberMe ($seconds=null)
static forgetMe ()
static rememberUntil ($seconds=0)
static sessionExists ()
static isDestroyed ()
static start ($options=false)
static isStarted ()
static isRegenerated ()
static getId ()
static setId ($id)
static registerValidator (Zend_Session_Validator_Interface $validator)
static stop ()
static writeClose ($readonly=true)
static destroy ($remove_cookie=true, $readonly=true)
static expireSessionCookie ()
static namespaceIsset ($namespace)
static namespaceUnset ($namespace)
static namespaceGet ($namespace)
static getIterator ()
static isWritable ()
static isReadable ()

Static Public Attributes

static $_unitTestEnabled = false

Protected Member Functions

 __construct ()

Static Protected Attributes

static $_throwStartupExceptions = true

Detailed Description

Definition at line 49 of file Session.php.


Constructor & Destructor Documentation

__construct (  ) [protected]

Constructor overriding - make sure that a developer cannot instantiate

Definition at line 187 of file Session.php.


Member Function Documentation

static destroy ( remove_cookie = true,
readonly = true 
) [static]

destroy() - This is used to destroy session data, and optionally, the session cookie itself

Parameters:
bool$remove_cookie- OPTIONAL remove session id cookie, defaults to true (remove cookie)
bool$readonly- OPTIONAL remove write access (i.e. throw error if Zend_Session's attempt writes)
Returns:
void

Definition at line 711 of file Session.php.

static expireSessionCookie (  ) [static]

expireSessionCookie() - Sends an expired session id cookie, causing the client to delete the session cookie

Returns:
void

Definition at line 739 of file Session.php.

static forgetMe (  ) [static]

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.

Returns:
void

Definition at line 356 of file Session.php.

static getId (  ) [static]

getId() - get the current session id

Returns:
string

Definition at line 616 of file Session.php.

static getIterator (  ) [static]

getIterator() - return an iteratable object for use in foreach and the like, this completes the IteratorAggregate interface

Exceptions:
Zend_Session_Exception
Returns:
ArrayObject

See also:
Zend_Session_Exception

Definition at line 835 of file Session.php.

static getOptions ( optionName = null ) [static]

getOptions()

Parameters:
string$optionNameOPTIONAL
Returns:
array|string

Definition at line 238 of file Session.php.

static getSaveHandler (  ) [static]

getSaveHandler() - Get the session Save Handler

Returns:
Zend_Session_SaveHandler_Interface

Definition at line 288 of file Session.php.

static isDestroyed (  ) [static]

Whether or not session has been destroyed via session_destroy()

Returns:
bool

Definition at line 414 of file Session.php.

static isReadable (  ) [static]

isReadable() - returns a boolean indicating if namespaces can write (use setters)

Returns:
bool

Definition at line 873 of file Session.php.

static isRegenerated (  ) [static]

isRegenerated() - convenience method to determine if session_regenerate_id() has been called during this request by Zend_Session.

Returns:
bool

Definition at line 605 of file Session.php.

static isStarted (  ) [static]

isStarted() - convenience method to determine if the session is already started.

Returns:
bool

Definition at line 593 of file Session.php.

static isWritable (  ) [static]

isWritable() - returns a boolean indicating if namespaces can write (use setters)

Returns:
bool

Definition at line 862 of file Session.php.

static namespaceGet ( namespace ) [static]

namespaceGet() - get all variables in a namespace Deprecated: Use getIterator() in Zend_Session_Namespace.

Parameters:
string$namespace
Returns:
array

Definition at line 822 of file Session.php.

static namespaceIsset ( namespace ) [static]

namespaceIsset() - check to see if a namespace is set

Parameters:
string$namespace
Returns:
bool

Definition at line 795 of file Session.php.

static namespaceUnset ( namespace ) [static]

namespaceUnset() - unset a namespace or a variable within a namespace

Parameters:
string$namespace
Exceptions:
Zend_Session_Exception
Returns:
void

Definition at line 808 of file Session.php.

static regenerateId (  ) [static]

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.

Exceptions:
Zend_Session_Exception
Returns:
void

See also:
Zend_Session_Exception
Todo:
If we can detect that this requester had no session previously, then why regenerate the id before the session has started? Feedback wanted for:

if (isset($_COOKIE[session_name()]) || (!use only cookies && isset($_REQUEST[session_name()]))) { self::$_regenerateIdState = 1; } else { self::$_regenerateIdState = -1; }

Definition at line 302 of file Session.php.

static registerValidator ( Zend_Session_Validator_Interface $  validator ) [static]

registerValidator() - register a validator that will attempt to validate this session for every future request

Parameters:
Zend_Session_Validator_Interface$validator
Returns:
void

Definition at line 661 of file Session.php.

static rememberMe ( seconds = null ) [static]

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.

Parameters:
$secondsinteger - OPTIONAL specifies TTL for cookie in seconds from present time
Returns:
void

Definition at line 341 of file Session.php.

static rememberUntil ( seconds = 0 ) [static]

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()

Parameters:
int$seconds
Returns:
void

Definition at line 369 of file Session.php.

static sessionExists (  ) [static]

sessionExists() - whether or not a session exists for the current request

Returns:
bool

Definition at line 395 of file Session.php.

static setId ( id ) [static]

setId() - set an id to a user specified id

Exceptions:
Zend_Session_Exception
Parameters:
string$id
Returns:
void

See also:
Zend_Session_Exception
Zend_Session_Exception
Zend_Session_Exception

Definition at line 629 of file Session.php.

static setOptions ( array $  userOptions = array() ) [static]

setOptions - set both the class specified

Parameters:
array$userOptions- pass-by-keyword style array of <option name, option value> pairs
Exceptions:
Zend_Session_Exception
Returns:
void

See also:
Zend_Session_Exception

Definition at line 199 of file Session.php.

static setSaveHandler ( Zend_Session_SaveHandler_Interface $  saveHandler ) [static]

setSaveHandler() - Session Save Handler assignment

Parameters:
Zend_Session_SaveHandler_Interface$interface
Returns:
void

Definition at line 264 of file Session.php.

static start ( options = false ) [static]

start() - Start the session.

Parameters:
bool | array$optionsOPTIONAL Either user supplied options, or flag indicating if start initiated automatically
Exceptions:
Zend_Session_Exception
Returns:
void

See also:
Zend_Session_Exception
Zend_Session_Exception
Zend_Session_Exception

Hack to throw exceptions on start instead of php errors

See also:
http://framework.zend.com/issues/browse/ZF-1325
Zend_Session_Exception

Definition at line 427 of file Session.php.

static stop (  ) [static]

stop() - Disable write access. Optionally disable read (not implemented).

Returns:
void

Definition at line 672 of file Session.php.

static writeClose ( readonly = true ) [static]

writeClose() - Shutdown the sesssion, close writing and detach $_SESSION from the back-end storage mechanism. This will complete the internal data transformation on this request.

Parameters:
bool$readonly- OPTIONAL remove write access (i.e. throw error if Zend_Session's attempt writes)
Returns:
void

Definition at line 685 of file Session.php.


Field Documentation

$_unitTestEnabled = false [static]

Whether or not Zend_Session is being used with unit tests

Definition at line 57 of file Session.php.


The documentation for this class was generated from the following file: