|
Previous Class |
Solar_Session |
Next Page |
Solar_Session
Class for working with the $_SESSION array, including read-once flashes.
On instantiation, starts a session if one has not yet been started.
Instantiate this once for each class that wants access to $_SESSION values. It automatically segments $_SESSION by class name, so be sure to use setClass() (or the 'class' config key) to identify the segment properly.
A "flash" is a session value that propagates only until it is read, at which time it is removed from the session. Taken from ideas popularized by Ruby on Rails, this is useful for forwarding information and messages between page loads without using GET vars or cookies.
Catalog
This class is part of the Solar package.
Inheritance:
- Solar_Base
- Solar_Session
Constants
None.
Public Properties
These are all the public properties in the Solar_Session class.
You can also view the list of all public, protected, and private properties.
$flash- Array of read-once "flash" keys and values.
$store- Array of "normal" session keys and values.
Public Methods
These are all the public methods in the Solar_Session class.
You can also view the list of all public, protected, and private methods.
__construct()- Constructor.
__destruct()- Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().
add()- Appends a normal value to a key.
addFlash()- Appends a flash value to a key.
apiVersion()- Reports the API version for this class.
dump()- Convenience method for getting a dump the whole object, or one of its properties, or an external variable.
get()- Gets a normal value by key, or an alternative default value if the key does not exist.
getFlash()- Gets a flash value by key, thereby removing the value.
locale()- Looks up class-specific locale strings based on a key.
regenerateId()- Regenerates the session ID and deletes the previous session store.
reset()- Resets (clears) all normal keys and values.
resetAll()- Resets both "normal" and "flash" values.
resetFlash()- Resets (clears) all flash keys and values.
set()- Sets a normal value by key.
setClass()- Sets the class segment for $_SESSION.
setFlash()- Sets a flash value by key.