- Symphony 2.7.5
-
› assets
14 -
› boot
15 -
› core
24 -
› cryptography
4 -
› data-sources
6 -
› email-gateways
3 -
› events
3 -
› global
61 -
› interface
9 -
› toolkit
60 - Delegates101
- Deprecated28
Versions
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.3
- 2.7.2
- 2.7.10
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.11
- 2.6.10
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2
Options
public class Session
class.session.php #19The Session class is a handler for all Session related logic in PHP. The functions
map directly to all handler functions as defined by sessionsetsave_handler in
PHP. In Symphony, this function is used in conjunction with the Cookie
class.
Based on: http://php.net/manual/en/function.session-set-save-handler.php#81761
by klose at openriverbed dot de which was based on
http://php.net/manual/en/function.session-set-save-handler.php#79706 by
maria at junkies dot jp
Methods
static boolean close()
Allows the Session to close without any further logic. Acts as a destructor function for the Session.
Returns
Always returns true
static boolean destroy(
$id)
Given a session's ID, remove it's row from tbl_sessions
Parameters
Returns
true if the Session was deleted successfully, false otherwise
static boolean gc(
$max)
The garbage collector, which removes all empty Sessions, or any
Sessions that have expired. This has a 10% chance of firing based
off the gc_probability
/gc_divisor
.
Parameters
Returns
true on Session deletion, false if an error occurs
static string|null getDomain()
Returns the current domain for the Session to be saved to, if the installation is on localhost, this returns null and just allows PHP to take care of setting the valid domain for the Session, otherwise it will return the non-www version of the domain host.
Returns
Null if on localhost, or HTTP_HOST is not set, a string of the domain name sans www otherwise
static boolean open()
Allows the Session to open without any further logic.
Returns
Always returns true
static string read(
$id)
Given a session's ID, return it's row from tbl_sessions
Parameters
Returns
The serialised session data
static string|boolean start(
$lifetime, $path, $domain, $httpOnly, $secure)
Starts a Session object, only if one doesn't already exist. This function maps the Session Handler functions to this classes methods by reading the default information from the PHP ini file.
Parameters
Returns
Returns the Session ID on success, or false on error.
See Also
static boolean write(
$id, $data)
Given an ID, and some data, save it into tbl_sessions
. This uses
the ID as a unique key, and will override any existing data. If the
$data
is deemed to be empty, no row will be saved in the database
unless there is an existing row.
Parameters
Returns
true if the Session information was saved successfully, false otherwise