Session

copyright CONTREXX CMS - COMVATION AG
author Leandro Nery
author Ivan Schmid
version $Id: Exp $
package contrexx
subpackage core

 Methods

Clear temp path's which are not in use

cleanTempPaths() 

Callable on session close

cmsSessionClose() : boolean

Returns

boolean

Callable on session destroy

cmsSessionDestroy(\type $aKey, \type $destroyCookie) : boolean

Parameters

$aKey

\type

$destroyCookie

\type

Returns

boolean

Destroy session by given user id

cmsSessionDestroyByUserId(integer $userId) : boolean

Parameters

$userId

integer

Returns

boolean

Callable on session error

cmsSessionError() 

expands a running session by @link Session::lifetime seconds.

cmsSessionExpand() 

called on pageload.

Clear expired session

cmsSessionGc() : boolean

Returns

boolean

Callable method on session open

cmsSessionOpen($aSavaPath, $aSessionName) : boolean

Parameters

$aSavaPath

$aSessionName

Returns

boolean

Callable on session read

cmsSessionRead(\type $aKey) : string

Parameters

$aKey

\type

Returns

string

Update user status (frontend or backend)

cmsSessionStatusUpdate(string $status) : boolean

Parameters

$status

string

Returns

boolean

Update the user id of the current session

cmsSessionUserUpdate(integer $userId) : boolean

Parameters

$userId

integer

Returns

boolean

Callable on session write

cmsSessionWrite(\type $aKey, \type $aVal) : boolean

Parameters

$aKey

\type

$aVal

\type

Returns

boolean

Get the count of elements in the container array.

count() : int
Inherited
link http://php.net/manual/en/countable.count.php
inherited_from \Cx\Core\Model\RecursiveArrayAccess::count()

Returns

int

Current position of the array.

current() : mixed
Inherited
link http://php.net/manual/en/iterator.current.php
inherited_from \Cx\Core\Model\RecursiveArrayAccess::current()

Returns

mixed

Discard changes made to the $_SESSION-array.

discardChanges() 

If called, this method causes the session not to store any changes made to the $_SESSION-array to the database. Use this method when doing multiple ajax-requests simultaneously to prevent an unwanted session overwrite.

Read the data from database using variable id

getDataFromKey(integer $varId) : \Cx\Core\Model\RecursiveArrayAccess
Static

Parameters

$varId

integer

Returns

Get lock and retrive the values from database Callable from Recursive array access class on offsetGet

getFromDb(string $offset, object $arrObj) 
Static

Parameters

$offset

string

Offset

$arrObj

object

object array

getInstance()

getInstance() 
Static

Create's the lock in database

getLock(string $lockName, integer $lifeTime) 
Static

Parameters

$lockName

string

Lock name

$lifeTime

integer

Lock time

Return's mysql lock name

getLockName(string $key) : string
Static

Parameters

$key

string

lock key

Returns

stringlock name

Returns current session's temp path

getTempPath() : string

Returns

string

Gets a web temp path.

getWebTempPath() : string

This path is needed to work with the File-class from the framework.

Returns

string

Return true if the session is initialized and false otherwise.

isInitialized() : boolean
Static

Returns

booleantrue if the session is initialized and false otherwise.

Key of the current element.

key() : mixed
Inherited
link http://php.net/manual/en/iterator.key.php
inherited_from \Cx\Core\Model\RecursiveArrayAccess::key()

Returns

mixed

Move the internal point of the container array to the next item

next() : void
Inherited
link http://php.net/manual/en/iterator.next.php
inherited_from \Cx\Core\Model\RecursiveArrayAccess::next()

check a offset exists

offsetExists(mixed $offset) : boolean
Inherited
link http://php.net/manual/en/arrayaccess.offsetexists.php
inherited_from \Cx\Core\Model\RecursiveArrayAccess::offsetExists()

Parameters

$offset

mixed

An offset to check for.

Returns

booleantrue on success or false on failure.

Offset to retrieve

offsetGet(mixed $offset) : mixed

Parameters

$offset

mixed

The offset to retrieve.

Returns

mixedCan return all value types.

Offset to set

offsetSet(mixed $offset, $data) : null

Parameters

$offset

mixed

The offset to assign the value to.

$data

Returns

null

Offset to unset

offsetUnset(mixed $offset) : null
Inherited
link http://php.net/manual/en/arrayaccess.offsetunset.php
inherited_from \Cx\Core\Model\RecursiveArrayAccess::offsetUnset()

Parameters

$offset

mixed

The offset to unset.

Returns

null

Read the data from database and assign it into $_SESSION array

readData() 

Release the mysql lock

releaseLock(string $key) 

Parameters

$key

string

Lock name to released

It release all created locks

releaseLocks() 

Remove the session key and sub keys by given offset and parent id Callable from RecursiveArrayAccess class on offsetUnset

removeFromSession(string $offset, integer $parentId) 
Static

Parameters

$offset

string

session key name

$parentId

integer

parent id of the given session offset

Remove the session variable and its sub entries from database by given id

removeKeyFromDb(integer $keyId) 
Static

Parameters

$keyId

integer

Rewind the internal point of the container array.

rewind() : void
Inherited
link http://php.net/manual/en/iterator.rewind.php
inherited_from \Cx\Core\Model\RecursiveArrayAccess::rewind()

Output the data as a multidimensional array.

toArray() : array
Inherited
inherited_from \Cx\Core\Model\RecursiveArrayAccess::toArray()

Returns

array

Update given object to database Callable from RecursiveArrayAccess class on offsetSet

updateToDb(object $arrObj) 
Static

Parameters

$arrObj

object

session object array

Is the current key valid?

valid() : bool
Inherited
link http://php.net/manual/en/iterator.rewind.php
inherited_from \Cx\Core\Model\RecursiveArrayAccess::valid()

Returns

bool

Default object constructor.

__construct() 

Initializes the database.

initDatabase() 
access private

Initializes the status of remember me.

initRememberMe() 
access private

Sets the default session lifetimes and lifetime of the current session.

initSessionLifetime() 
access private

Expands debugging behaviour with behaviour stored in session if specified and active.

restoreDebuggingParams() 
access private

Checks if the passed session exists.

sessionExists($sessionId) : boolean
access private

Parameters

$sessionId

Returns

boolean

Sets the database debug mode.

setAdodbDebugMode() 
access private

 Properties

 

$instance : object
 

$sessionid : string
 

$status : string
 

$userId : integer
 

$callableOnGet : callable
Inherited
inherited_from \Cx\Core\Model\RecursiveArrayAccess::$$callableOnGet
 

$callableOnSet : callable
Inherited
inherited_from \Cx\Core\Model\RecursiveArrayAccess::$$callableOnSet
 

$callableOnUnset : callable
Inherited
inherited_from \Cx\Core\Model\RecursiveArrayAccess::$$callableOnUnset
 

$data : array
Inherited
inherited_from \Cx\Core\Model\RecursiveArrayAccess::$$data
 

$id : integer
Inherited
inherited_from \Cx\Core\Model\RecursiveArrayAccess::$$id
 

$offset : string
Inherited
inherited_from \Cx\Core\Model\RecursiveArrayAccess::$$offset
 

$parentId : \Cx\Core\Model\type
Inherited
inherited_from \Cx\Core\Model\RecursiveArrayAccess::$$parentId
 

$defaultLifetime : integer
 

$defaultLifetimeRememberMe : integer
 

$discardChanges : boolean
 

$lifetime : integer
 

$locks : array
 

$rememberMe : boolean
 

$sessionLockTime : integer
 

$sessionPath : string
 

$sessionPathPrefix : string
© Copyright 2014 by Comvation AG
Generated on 2014-07-11T08:39:23+02:00.