API Documentation

Session.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Session
since
Preview Release 0.2
version
$Id: Session.php 22588 2010-07-16 20:22:07Z ralph $
Classes
Zend_Session

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Session

Extends from
Zend_Session_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Session
Properties
$_unitTestEnabled
$_throwStartupExceptions
$_sessionStarted
$_regenerateIdState
$_defaultOptions
$_localOptions
$_writeClosed
$_sessionCookieDeleted
$_destroyed
$_strict
$_rememberMeSeconds
$_defaultOptionsSet
$_saveHandler
Methods
__construct
setOptions
getOptions
setSaveHandler
getSaveHandler
regenerateId
rememberMe
forgetMe
rememberUntil
sessionExists
isDestroyed
start
_processStartupMetadataGlobal
isStarted
isRegenerated
getId
setId
registerValidator
stop
writeClose
destroy
expireSessionCookie
_processValidators
namespaceIsset
namespaceUnset
namespaceGet
getIterator
isWritable
isReadable

Description

Zend_Session

Properties

$_defaultOptions

array $_defaultOptions = 'array'

Private list of php's ini values for ext/session null values will default to the php.ini value, otherwise the value below will overwrite the default ini value, unless the user has set an option explicity with setOptions()

Details

$_defaultOptions
array
visibility
private
default
array
final
false
static
true

$_defaultOptionsSet

bool $_defaultOptionsSet = 'false'

Whether the default options listed in Zend_Session::$_localOptions have been set

Details

$_defaultOptionsSet
bool
visibility
private
default
false
final
false
static
true

$_destroyed

bool $_destroyed = 'false'

Whether or not session has been destroyed via session_destroy()

Details

$_destroyed
bool
visibility
private
default
false
final
false
static
true

$_localOptions

array $_localOptions = 'array'

List of options pertaining to Zend_Session that can be set by developers using Zend_Session::setOptions(). This list intentionally duplicates the individual declaration of static "class" variables by the same names.

Details

$_localOptions
array
visibility
private
default
array
final
false
static
true

$_regenerateIdState

int $_regenerateIdState = '0'

Whether or not the session id has been regenerated this request.

Id regeneration state <0 - regenerate requested when session is started 0 - do nothing

0 - already called session_regenerate_id()

Details

$_regenerateIdState
int
visibility
private
default
0
final
false
static
true

$_rememberMeSeconds

int $_rememberMeSeconds = '1209600'

Default number of seconds the session will be remembered for when asked to be remembered

Details

$_rememberMeSeconds
int
visibility
private
default
1209600
final
false
static
true

$_saveHandler

Zend_Session_SaveHandler_Interface $_saveHandler = 'null'

A reference to the set session save handler

Details

$_saveHandler
Zend_Session_SaveHandler_Interface
visibility
private
default
null
final
false
static
true

$_sessionCookieDeleted

bool $_sessionCookieDeleted = 'false'

Whether or not session id cookie has been deleted

Details

$_sessionCookieDeleted
bool
visibility
private
default
false
final
false
static
true

$_sessionStarted

bool $_sessionStarted = 'false'

Check whether or not the session was started

Details

$_sessionStarted
bool
visibility
private
default
false
final
false
static
true

$_strict

bool $_strict = 'false'

Whether or not session must be initiated before usage

Details

$_strict
bool
visibility
private
default
false
final
false
static
true

$_throwStartupExceptions

bool|bitset $_throwStartupExceptions = 'true'

$_throwStartupException

Details

$_throwStartupExceptions
bool|bitset
This could also be a combiniation of error codes to catch
visibility
protected
default
true
final
false
static
true

$_unitTestEnabled

bool $_unitTestEnabled = 'false'

Whether or not Zend_Session is being used with unit tests

Details

$_unitTestEnabled
bool
visibility
public
default
false
final
false
static
true
internal

$_writeClosed

bool $_writeClosed = 'false'

Whether or not write close has been performed.

Details

$_writeClosed
bool
visibility
private
default
false
final
false
static
true

Methods

__construct

__construct( ) :

Constructor overriding - make sure that a developer cannot instantiate

Details
visibility
protected
final
false
static
false

_processStartupMetadataGlobal

_processStartupMetadataGlobal( ) : void

_processGlobalMetadata() - this method initizes the sessions GLOBAL metadata, mostly global data expiration calculations.

Details
visibility
private
final
false
static
true

_processValidators

_processValidators( ) : void

_processValidator() - internal function that is called in the existence of VALID metadata

Details
visibility
private
final
false
static
true
throws

destroy

destroy( bool $remove_cookie = true, bool $readonly = true ) : void

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

Arguments
$remove_cookie
bool
- OPTIONAL remove session id cookie, defaults to true (remove cookie)
$readonly
bool
- OPTIONAL remove write access (i.e. throw error if Zend_Session&#039;s attempt writes)
Details
visibility
public
final
false
static
true

expireSessionCookie

expireSessionCookie( ) : void

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

Details
visibility
public
final
false
static
true

forgetMe

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.

Details
visibility
public
final
false
static
true

getId

getId( ) : string

getId() - get the current session id

Output
string
Details
visibility
public
final
false
static
true

getIterator

getIterator( ) : ArrayObject

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

Output
ArrayObject
Details
visibility
public
final
false
static
true
throws

getOptions

getOptions( string $optionName = null ) : array|string

getOptions()

Arguments
$optionName
string
OPTIONAL
Output
array|string
Details
visibility
public
final
false
static
true

getSaveHandler

getSaveHandler( ) : Zend_Session_SaveHandler_Interface

getSaveHandler() - Get the session Save Handler

Details
visibility
public
final
false
static
true

isDestroyed

isDestroyed( ) : bool

Whether or not session has been destroyed via session_destroy()

Output
bool
Details
visibility
public
final
false
static
true

isReadable

isReadable( ) : bool

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

Output
bool
Details
visibility
public
final
false
static
true

isRegenerated

isRegenerated( ) : bool

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

Output
bool
Details
visibility
public
final
false
static
true

isStarted

isStarted( ) : bool

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

Output
bool
Details
visibility
public
final
false
static
true

isWritable

isWritable( ) : bool

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

Output
bool
Details
visibility
public
final
false
static
true

namespaceGet

namespaceGet( string $namespace ) : array

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

Arguments
$namespace
string
Output
array
Details
visibility
public
final
false
static
true

namespaceIsset

namespaceIsset( string $namespace ) : bool

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

Arguments
$namespace
string
Output
bool
Details
visibility
public
final
false
static
true

namespaceUnset

namespaceUnset( string $namespace ) : void

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

Arguments
$namespace
string
Details
visibility
public
final
false
static
true
throws

regenerateId

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.

Details
visibility
public
final
false
static
true
throws

registerValidator

registerValidator( Zend_Session_Validator_Interface $validator ) : void

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

Arguments
$validator
Zend_Session_Validator_Interface
Details
visibility
public
final
false
static
true

rememberMe

rememberMe( $seconds $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.

Arguments
$seconds
$seconds
integer - OPTIONAL specifies TTL for cookie in seconds from present time
Details
visibility
public
final
false
static
true

rememberUntil

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

Arguments
$seconds
int
Details
visibility
public
final
false
static
true

sessionExists

sessionExists( ) : bool

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

Output
bool
Details
visibility
public
final
false
static
true

setId

setId( string $id ) : void

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

Arguments
$id
string
Details
visibility
public
final
false
static
true
throws

setOptions

setOptions( array $userOptions = array ) : void

setOptions - set both the class specified

Arguments
$userOptions
array
- pass-by-keyword style array of &lt;option name, option value&gt; pairs
Details
visibility
public
final
false
static
true
throws

setSaveHandler

setSaveHandler(  $saveHandler ) : void

setSaveHandler() - Session Save Handler assignment

Arguments
$saveHandler
Details
visibility
public
final
false
static
true

start

start( bool|array $options = false ) : void

start() - Start the session.

Arguments
$options
boolarray
OPTIONAL Either user supplied options, or flag indicating if start initiated automatically
Details
visibility
public
final
false
static
true
throws

stop

stop( ) : void

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

Details
visibility
public
final
false
static
true

writeClose

writeClose( bool $readonly = true ) : void

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.

Arguments
$readonly
bool
- OPTIONAL remove write access (i.e. throw error if Zend_Session&#039;s attempt writes)
Details
visibility
public
final
false
static
true
Documentation was generated by DocBlox.