public
|
#
__construct( string $store = 'none', array $options = array() )
Constructor
Parameters
- $store
string - $store The type of storage for the session.
- $options
array - $options Optional parameters
Since
1.0
|
public
mixed
|
#
__get( string $name )
Magic method to get read-only access to properties.
Magic method to get read-only access to properties.
Deprecated
2.0 Use get methods for non-deprecated properties
Parameters
- $name
string - $name Name of property to retrieve
Returns
mixed - The value of the property
Since
1.0
|
public static
Joomla\Session\Session
|
#
getInstance( string $handler, array $options = array () )
Returns the global Session object, only creating it if it doesn't already
exist.
Returns the global Session object, only creating it if it doesn't already
exist.
Deprecated
2.0 A singleton object store will no longer be supported
Parameters
- $handler
string - $handler The type of session handler.
- $options
array - $options An array of configuration options (for new sessions only).
Returns
Since
1.0
|
public
string
|
#
getState( )
Get current state of session
Get current state of session
Returns
string - The session state
Since
1.0
|
public
integer
|
#
getExpire( )
Get expiration time in minutes
Get expiration time in minutes
Returns
integer - The session expiration time in minutes
Since
1.0
|
public
string
|
#
getToken( boolean $forceNew = false )
Get a session token, if a token isn't set yet one will be generated.
Get a session token, if a token isn't set yet one will be generated.
Tokens are used to secure forms from spamming attacks. Once a token has been
generated the system will check the post request to see if it is present, if not
it will invalidate the session.
Parameters
- $forceNew
boolean - $forceNew If true, force a new token to be created
Returns
string - The session token
Since
1.0
|
public
boolean
|
#
hasToken( string $tCheck, boolean $forceExpire = true )
Method to determine if a token exists in the session. If not the session will
be set to expired
Method to determine if a token exists in the session. If not the session will
be set to expired
Parameters
- $tCheck
string - $tCheck Hashed token to be verified
- $forceExpire
boolean - $forceExpire If true, expires the session
Returns
boolean
Since
1.0
|
public
ArrayIterator
|
#
getIterator( )
Retrieve an external iterator.
Retrieve an external iterator.
Returns
Since
1.0
Implementation of
|
public
string
|
#
getName( )
Get session name
Returns
string - The session name
Since
1.0
|
public
string
|
#
getId( )
Get session id
Returns
string - The session name
Since
1.0
|
public static
array
|
#
getStores( )
Get the session handlers
Deprecated
2.0 The Storage class chain will be removed
Returns
array - An array of available session handlers
Since
1.0
|
public
boolean
|
#
isActive( )
Shorthand to check if the session is active
Shorthand to check if the session is active
Returns
boolean
Since
1.0
|
public
boolean
|
#
isNew( )
Check whether this session is currently created
Check whether this session is currently created
Returns
boolean - True on success.
Since
1.0
|
public
|
|
public
mixed
|
#
get( string $name, mixed $default = null, string $namespace = 'default' )
Get data from the session store
Get data from the session store
Parameters
- $name
string - $name Name of a variable
- $default
mixed - $default Default value of a variable if not set
- $namespace
string - $namespace Namespace to use, default to 'default' {@deprecated 2.0 Namespace
support will be removed.}
Returns
mixed - Value of a variable
Since
1.0
|
public
mixed
|
#
set( string $name, mixed $value = null, string $namespace = 'default' )
Set data into the session store.
Set data into the session store.
Parameters
- $name
string - $name Name of a variable.
- $value
mixed - $value Value of a variable.
- $namespace
string - $namespace Namespace to use, default to 'default' {@deprecated 2.0 Namespace
support will be removed.}
Returns
mixed - Old value of a variable.
Since
1.0
|
public
boolean
|
#
has( string $name, string $namespace = 'default' )
Check whether data exists in the session store
Check whether data exists in the session store
Parameters
- $name
string - $name Name of variable
- $namespace
string - $namespace Namespace to use, default to 'default' {@deprecated 2.0 Namespace
support will be removed.}
Returns
boolean - True if the variable exists
Since
1.0
|
public
mixed
|
#
clear( string $name, string $namespace = 'default' )
Unset data from the session store
Unset data from the session store
Parameters
- $name
string - $name Name of variable
- $namespace
string - $namespace Namespace to use, default to 'default' {@deprecated 2.0 Namespace
support will be removed.}
Returns
mixed - The value from session or NULL if not set
Since
1.0
|
public
|
#
start( )
Start a session.
Since
1.0
|
protected
boolean
|
#
_start( )
Start a session.
Creates a session (or resumes the current one based on the state of the
session)
Deprecated
2.0
Returns
boolean - true on success
Since
1.0
|
public
boolean
|
#
destroy( )
Frees all session variables and destroys all data registered to a session
Frees all session variables and destroys all data registered to a session
This method resets the $_SESSION variable and destroys all of the data
associated with the current session in its storage (file or DB). It forces new
session to be started after this method is called. It does not unset the session
cookie.
Returns
boolean - True on success
Since
1.0
See
session_destroy()
session_unset()
|
public
boolean
|
#
restart( )
Restart an expired or locked session.
Restart an expired or locked session.
Returns
boolean - True on success
Since
1.0
See
|
public
boolean
|
#
fork( )
Create a new session and copy variables from the old one
Create a new session and copy variables from the old one
Returns
boolean - $result true on success
Since
1.0
|
public
|
#
close( )
Writes session data and ends session
Writes session data and ends session
Session data is usually stored after your script terminated without the need
to call JSession::close(), but as session data is locked to prevent concurrent
writes only one script may operate on a session at any time. When using
framesets together with sessions you will experience the frames loading one by
one due to this locking. You can reduce the time needed to load all the frames
by ending the session as soon as all changes to session variables are done.
Since
1.0
See
session_write_close()
|
protected
mixed
|
#
setExpire( integer $expire )
Set the session expiration
Set the session expiration
Parameters
- $expire
integer - $expire Maximum age of unused session in minutes
Returns
mixed - $this
Since
1.3.0
|
protected
mixed
|
#
setState( string $state )
Set the session state
Parameters
- $state
string - $state Internal state
Returns
mixed - $this
Since
1.3.0
|
protected
|
#
_setCookieParams( )
Set session cookie parameters
Set session cookie parameters
Deprecated
2.0
Since
1.0
|
protected
string
|
#
_createToken( integer $length = 32 )
Create a token-string
Deprecated
2.0 Use createToken instead
Parameters
- $length
integer - $length Length of string
Returns
string - Generated token
Since
1.0
|
protected
string
|
#
createToken( integer $length = 32 )
Create a token-string
Parameters
- $length
integer - $length Length of string
Returns
string - Generated token
Since
1.3.1
|
protected
boolean
|
#
_setCounter( )
Set counter of session usage
Set counter of session usage
Deprecated
2.0 Use setCounter instead
Returns
boolean - True on success
Since
1.0
|
protected
boolean
|
#
setCounter( )
Set counter of session usage
Set counter of session usage
Returns
boolean - True on success
Since
1.3.0
|
protected
boolean
|
#
_setTimers( )
Set the session timers
Deprecated
2.0 Use setTimers instead
Returns
boolean - True on success
Since
1.0
|
protected
boolean
|
#
setTimers( )
Set the session timers
Returns
boolean - True on success
Since
1.3.0
|
protected
boolean
|
#
_setOptions( array $options )
Set additional session options
Set additional session options
Deprecated
2.0 Use setOptions instead
Parameters
- $options
array - $options List of parameter
Returns
boolean - True on success
Since
1.0
|
protected
boolean
|
#
setOptions( array $options )
Set additional session options
Set additional session options
Parameters
- $options
array - $options List of parameter
Returns
boolean - True on success
Since
1.3.0
|
protected
boolean
|
#
_validate( boolean $restart = false )
Do some checks for security reason
Do some checks for security reason
- timeout check (expire)
- ip-fixiation
- browser-fixiation
If one check failed, session data has to be cleaned.
Deprecated
2.0 Use validate instead
Parameters
- $restart
boolean - $restart Reactivate session
Returns
boolean - True on success
Since
1.0
See
|
protected
boolean
|
#
validate( boolean $restart = false )
Do some checks for security reason
Do some checks for security reason
- timeout check (expire)
- ip-fixiation
- browser-fixiation
If one check failed, session data has to be cleaned.
Parameters
- $restart
boolean - $restart Reactivate session
Returns
boolean - True on success
Since
1.3.0
See
|