Session Interface Reference

Detailed Description

Session is the interface for session implementations and defines access to session variables.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 19 of file Session.php.

+ Inheritance diagram for Session:

Public Member Functions

 isStarted ()
 
 getID ()
 
 get ($key, $default=null)
 
 set ($key, $value)
 
 remove ($key)
 
 exist ($key)
 
 clear ()
 
 destroy ()
 
 setAuthUser ($login)
 
 getAuthUser ()
 

Member Function Documentation

◆ isStarted()

isStarted ( )

Check if the session is started.

Returns
Boolean.

Implemented in ClientSideSession, and DefaultSession.

◆ getID()

getID ( )

Get the id of the session.

Returns
The id of the current session.

Implemented in ClientSideSession, and DefaultSession.

◆ get()

get (   $key,
  $default = null 
)

Returns the value of a session variable.

Parameters
$keyThe key (name) of the session vaiable.
$defaultThe default value if the key is not defined (optional, default: null)
Returns
The session var or null if it doesn't exist.

Implemented in ClientSideSession, and DefaultSession.

◆ set()

set (   $key,
  $value 
)

Sets the value of a session variable.

Parameters
$keyThe key (name) of the session vaiable.
$valueThe value of the session variable.

Implemented in ClientSideSession, and DefaultSession.

◆ remove()

remove (   $key)

Remove a session variable.

Parameters
$keyThe key (name) of the session variable.

Implemented in ClientSideSession, and DefaultSession.

◆ exist()

exist (   $key)

Tests, if a certain session variable is defined.

Parameters
$keyThe key (name) of the session variable.
Returns
Boolean whether the session variable is set or not.

Implemented in ClientSideSession, and DefaultSession.

◆ clear()

clear ( )

Clear the session data.

Implemented in ClientSideSession, and DefaultSession.

◆ destroy()

destroy ( )

Destroy the session.

Implemented in ClientSideSession, and DefaultSession.

◆ setAuthUser()

setAuthUser (   $login)

Set the login of authenticated user.

Parameters
$loginLogin name of the user

Implemented in ClientSideSession, DefaultSession, and AuthTokenSession.

◆ getAuthUser()

getAuthUser ( )

Get the login of the authenticated user.

Returns
String

Implemented in ClientSideSession, DefaultSession, and AuthTokenSession.