FluentSession
class FluentSession extends Session (View source)
Because there is not always an active controller (such as during pre-request filters) FluentSession will ensure the correct session object is injected as necessary
Properties
protected | $data | Session data |
from Session | |
protected | $changedData | from Session | ||
protected static | $default_session | from Session | ||
protected static | Session | $old_session | Current session |
Methods
Start PHP session, then create a new Session object with the given start data.
Path to set on the domain where the session cookie will work.
Secure cookie, tells the browser to only send it over SSL.
Provide an array
of rules specifing timeouts for IPv4 address ranges or
individual IPv4 addresses. The key is an IP address or range and the value is the time
until the session expires in seconds. For example:
Add a value to a specific key in the session array
Save data to session Only save the changes, so that anyone manipulating $_SESSION directly doesn't get burned.
Recursively apply the changes represented in $data to $dest.
Sets the appropriate form message in session, with type. This will be shown once, for the form specified.
Allows session to be temporarily injected into default_session prior to the existence of a controller
Details
protected
userAgent()
No description
__construct($data)
Start PHP session, then create a new Session object with the given start data.
static
set_cookie_domain(string $domain)
deprecated
deprecated
Cookie domain, for example 'www.php.net'.
To make cookies visible on all subdomains then the domain must be prefixed with a dot like '.php.net'.
static string
get_cookie_domain()
deprecated
deprecated
Get the cookie domain.
static
set_cookie_path(string $path)
deprecated
deprecated
Path to set on the domain where the session cookie will work.
Use a single slash ('/') for all paths on the domain.
static string
get_cookie_path()
deprecated
deprecated
Get the path on the domain where the session cookie will work.
static
set_cookie_secure(bool $secure)
deprecated
deprecated
Secure cookie, tells the browser to only send it over SSL.
static bool
get_cookie_secure()
deprecated
deprecated
Get if the cookie is secure
static
set_session_store_path(string $path)
deprecated
deprecated
Set the session store path
static string
get_session_store_path()
deprecated
deprecated
Get the session store path
static
set_timeout_ips($ips)
deprecated
deprecated
Provide an array
of rules specifing timeouts for IPv4 address ranges or
individual IPv4 addresses. The key is an IP address or range and the value is the time
until the session expires in seconds. For example:
Session::set_timeout_ips(array( '127.0.0.1' => 36000 ));
Any user connecting from 127.0.0.1 (localhost) will have their session expired after 10 hours.
Session::set_timeout is used to set the timeout value for any users whose address is not in the given IP range.
static
add_to_array($name, $val)
Add a value to a specific key in the session array
static
set(string $name, string $val)
Set a key/value pair in the session
static
get(string $name)
Return a specific value by session key
static array
get_all()
Return all the values in session
static
clear(string $name)
Clear a given session key, value pair.
static void
clear_all()
Clear all the values
static
save()
Save all the values in our session to $_SESSION
static protected
current_session()
No description
inst_start($sid = null)
No description
inst_destroy($removeCookie = true)
No description
inst_set($name, $val)
No description
inst_addToArray($name, $val)
No description
inst_get($name)
No description
inst_clear($name)
No description
inst_clearAll()
No description
inst_getAll()
No description
inst_finalize()
No description
inst_save()
Save data to session Only save the changes, so that anyone manipulating $_SESSION directly doesn't get burned.
protected
recursivelyApply($data, $dest)
Recursively apply the changes represented in $data to $dest.
Used to update $_SESSION
array
inst_changedData()
Return the changed data, for debugging purposes.
static
setFormMessage(string $formname, string $message, string $type)
Sets the appropriate form message in session, with type. This will be shown once, for the form specified.
static bool
request_contains_session_id()
Is there a session ID in the request?
static
start(string $sid = null)
Initialize session.
static
destroy(bool $removeCookie = true)
Destroy the active session.
static
set_timeout(int $timeout)
deprecated
deprecated
Set the timeout of a Session value
static
get_timeout()
deprecated
deprecated
No description
static
with_session(Session $session, $callback)
Allows session to be temporarily injected into default_session prior to the existence of a controller