class JTableSession extends JTable

Session table

Methods

__construct( JDatabaseDriver $db)

Constructor

boolean
insert( string $sessionId, integer $clientId)

Insert a session

boolean
update( boolean $updateNulls = false)

Updates the session

boolean
destroy( integer $userId, array $clientIds = array())

Destroys the pre-existing session

mixed
purge( integer $maxLifetime = 1440)

Purge old sessions

boolean
exists( integer $userid)

Find out if a user has one or more active sessions

mixed
delete( integer $oid = null)

Overloaded delete method

Details

__construct( JDatabaseDriver $db)

Constructor

Parameters

JDatabaseDriver $db Database driver object.

boolean insert( string $sessionId, integer $clientId)

Insert a session

Parameters

string $sessionId The session id
integer $clientId The id of the client application

Return Value

boolean True on success

boolean update( boolean $updateNulls = false)

Updates the session

Parameters

boolean $updateNulls True to update fields even if they are null.

Return Value

boolean True on success.

boolean destroy( integer $userId, array $clientIds = array())

Destroys the pre-existing session

Parameters

integer $userId Identifier of the user for this session.
array $clientIds Array of client ids for which session(s) will be destroyed

Return Value

boolean True on success.

mixed purge( integer $maxLifetime = 1440)

Purge old sessions

Parameters

integer $maxLifetime Session age in seconds

Return Value

mixed Resource on success, null on fail

boolean exists( integer $userid)

Find out if a user has one or more active sessions

Parameters

integer $userid The identifier of the user

Return Value

boolean True if a session for this user exists

mixed delete( integer $oid = null)

Overloaded delete method

We must override it because of the non-integer primary key

Parameters

integer $oid The object id (optional).

Return Value

mixed True if successful otherwise an error message