\Zend_Session
Zend_Session
- Copyright: Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Session
extends Zend_Session_Abstract
{
- // Inherited constants from Zend_Session_Abstract
- const _THROW_NOT_WRITABLE_MSG = 'Zend_Session is currently marked as read-only.';
- const _THROW_NOT_READABLE_MSG = 'Zend_Session is not marked as readable.';
- // members
- public static bool $_unitTestEnabled = false;
- protected static bool|bitset $_throwStartupExceptions = true;
- private static bool $_sessionStarted = false;
- private static integer $_regenerateIdState = 0;
- private static array $_defaultOptions = ;
- private static array $_localOptions = ;
- private static bool $_writeClosed = false;
- private static bool $_sessionCookieDeleted = false;
- private static bool $_destroyed = false;
- private static bool $_strict = false;
- private static integer $_rememberMeSeconds = 1209600;
- private static bool $_defaultOptionsSet = false;
- private static Zend_Session_SaveHandler_Interface $_saveHandler = NULL;
- // Inherited members from Zend_Session_Abstract
- protected static bool $_writable;
- protected static bool $_readable;
- protected static array $_expiringData;
- // methods
- protected void __construct()
- public static void setOptions()
- public static array|string getOptions()
- public static void setSaveHandler()
- public static Zend_Session_SaveHandler_Interface getSaveHandler()
- public static void regenerateId()
- public static void rememberMe()
- public static void forgetMe()
- public static void rememberUntil()
- public static bool sessionExists()
- public static bool isDestroyed()
- public static void start()
- private static void _processStartupMetadataGlobal()
- public static bool isStarted()
- public static bool isRegenerated()
- public static string getId()
- public static void setId()
- public static void registerValidator()
- public static void stop()
- public static void writeClose()
- public static void destroy()
- public static void expireSessionCookie()
- private static void _processValidators()
- public static bool namespaceIsset()
- public static void namespaceUnset()
- public static array namespaceGet()
- public static ArrayObject getIterator()
- public static bool isWritable()
- public static bool isReadable()
- // Inherited methods from Zend_Session_Abstract
- protected static bool _namespaceIsset()
- protected static void _namespaceUnset()
- protected static mixed _namespaceGet()
- protected static mixed _namespaceGetAll()
Hierarchy
Extends
Constants
Name | Value |
---|---|
_THROW_NOT_WRITABLE_MSG | 'Zend_Session is currently marked as read-only.' |
_THROW_NOT_READABLE_MSG | 'Zend_Session is not marked as readable.' |
Members
private
- $_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() - $_defaultOptionsSet
—
bool
Whether the default options listed in Zend_Session::$_localOptions have been set - $_destroyed
—
bool
Whether or not session has been destroyed via session_destroy() - $_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. - $_regenerateIdState
—
int
Whether or not the session id has been regenerated this request. - $_rememberMeSeconds
—
int
Default number of seconds the session will be remembered for when asked to be remembered - $_saveHandler
—
Zend_Session_SaveHandler_Interface
A reference to the set session save handler - $_sessionCookieDeleted
—
bool
Whether or not session id cookie has been deleted - $_sessionStarted
—
bool
Check whether or not the session was started - $_strict
—
bool
Whether or not session must be initiated before usage - $_writeClosed
—
bool
Whether or not write close has been performed.
protected
- $_expiringData
—
array
Since expiring data is handled at startup to avoid __destruct difficulties, the data that will be expiring at end of this request is held here - $_readable
—
bool
Whether or not session permits reading (reading data in $_SESSION[]) - $_throwStartupExceptions
—
bool|bitset
$_throwStartupException - $_writable
—
bool
Whether or not session permits writing (modification of $_SESSION[])
public
- $_unitTestEnabled
—
bool
Whether or not Zend_Session is being used with unit tests
Methods
private
- _processStartupMetadataGlobal() — _processGlobalMetadata() - this method initizes the sessions GLOBAL metadata, mostly global data expiration calculations.
- _processValidators() — _processValidator() - internal function that is called in the existence of VALID metadata
public
- destroy() — destroy() - This is used to destroy session data, and optionally, the session cookie itself
- expireSessionCookie() — expireSessionCookie() - Sends an expired session id cookie, causing the client to delete the session cookie
- forgetMe() — 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.
- getId() — getId() - get the current session id
- getIterator() — getIterator() - return an iteratable object for use in foreach and the like, this completes the IteratorAggregate interface
- getOptions() — getOptions()
- getSaveHandler() — getSaveHandler() - Get the session Save Handler
- isDestroyed() — Whether or not session has been destroyed via session_destroy()
- isReadable() — isReadable() - returns a boolean indicating if namespaces can write (use setters)
- isRegenerated() — isRegenerated() - convenience method to determine if session_regenerate_id() has been called during this request by Zend_Session.
- isStarted() — isStarted() - convenience method to determine if the session is already started.
- isWritable() — isWritable() - returns a boolean indicating if namespaces can write (use setters)
- namespaceGet() — namespaceGet() - get all variables in a namespace Deprecated: Use getIterator() in Zend_Session_Namespace.
- namespaceIsset() — namespaceIsset() - check to see if a namespace is set
- namespaceUnset() — namespaceUnset() - unset a namespace or a variable within a namespace
- regenerateId() — 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.
- registerValidator() — registerValidator() - register a validator that will attempt to validate this session for every future request
- rememberMe() — 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.
- rememberUntil() — 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()
- sessionExists() — sessionExists() - whether or not a session exists for the current request
- setId() — setId() - set an id to a user specified id
- setOptions() — setOptions - set both the class specified
- setSaveHandler() — setSaveHandler() - Session Save Handler assignment
- start() — start() - Start the session.
- stop() — stop() - Disable write access. Optionally disable read (not implemented).
- writeClose() — writeClose() - Shutdown the sesssion, close writing and detach $_SESSION from the back-end storage mechanism.
Inherited from Zend_Session_Abstract
protected
- _namespaceGet() — namespaceGet() - Get $name variable from $namespace, returning by reference.
- _namespaceGetAll() — namespaceGetAll() - Get an array containing $namespace, including expiring data.
- _namespaceIsset() — namespaceIsset() - check to see if a namespace or a variable within a namespace is set
- _namespaceUnset() — namespaceUnset() - unset a namespace or a variable within a namespace