Methods summary
public
|
#
__construct( string $prefix = 'backend' )
cSession constructor. Starts a session if it does not yet exist.
cSession constructor. Starts a session if it does not yet exist.
Session cookies will be created with these parameters:
The session cookie will have a lifetime of 0 which means "until the browser
is closed".
It will be valid for the host name of the server which generated the cookie
and the path as in either the configured backend or frontend URL.
Parameters
- $prefix
string $prefix [optional] The prefix for the session variables
Since
CON-2785 the cookie path can be configured as $cfg['cookie']['path']. Configure
in <CLIENT>/data/config/<ENV>/config.local.php
CON-2423 Via $cfg['secure'] you can define if the cookie should only be sent
over secure connections. Configure in data/config/<ENV>/config.misc.php
The session cookie is accessible only through the HTTP protocol.
|
public
|
#
register( string $things )
Registers a global variable which will become persistent
Registers a global variable which will become persistent
Parameters
- $things
string $things The name of the variable (e.g. "idclient")
|
public
|
#
unregister( string $name )
Unregisters a variable
Parameters
- $name
string $name The name of the variable (e.g. "idclient")
|
public
boolean
|
#
isRegistered( string $name )
Checks if a variable is registered
Checks if a variable is registered
Parameters
- $name
string $name The name of the variable (e.g. "idclient")
Returns
boolean
|
public
mixed
|
#
url( string $url )
Attaches "&contenido=sessionid" at the end of the URL. This is no longer
needed to make sessions work but some CONTENIDO functions/classes rely on it
Attaches "&contenido=sessionid" at the end of the URL. This is no longer
needed to make sessions work but some CONTENIDO functions/classes rely on it
Parameters
Returns
mixed
|
public
mixed
|
#
selfURL( )
Attaches "&contenido=1" at the end of the current URL. This is no longer
needed to make sessions work but some CONTENIDO functions/classes rely on it
Attaches "&contenido=1" at the end of the current URL. This is no longer
needed to make sessions work but some CONTENIDO functions/classes rely on it
Returns
mixed
|
public
string
|
#
serialize( mixed $var )
Returns PHP code which can be used to rebuild the variable by evaluating it.
This will work recursevly on arrays
Returns PHP code which can be used to rebuild the variable by evaluating it.
This will work recursevly on arrays
Parameters
- $var
mixed $var A variable which should get serialized.
Returns
string the PHP code which can be evaluated.
|
protected
|
#
_rSerialize( mixed $var, string & $str )
This function will go recursevly through arrays and objects to serialize
them.
This function will go recursevly through arrays and objects to serialize
them.
Parameters
- $var
mixed $var The variable
- $str
string $str The PHP code will be attached to this string
|
public
|
#
freeze( )
Stores the session using PHP's own session implementation
Stores the session using PHP's own session implementation
|
public
|
#
thaw( )
Rebuilds every registered variable from the session.
Rebuilds every registered variable from the session.
|
public
|
#
delete( )
Deletes the session by calling session_destroy()
Deletes the session by calling session_destroy()
|
public
|
#
start( )
Starts the session and rebuilds the variables
Starts the session and rebuilds the variables
|