Skip to content

classes_essentials_session_sessionbase.class

Daniel Spors edited this page Dec 19, 2023 · 2 revisions

Classes in file essentials/session/sessionbase.class.php

abstract class SessionBase

Base class for SessionHandlers. Implements basic functionalities and defines some more as abstract which must be implemented by inherited classes.

Subclasses: DbSession, PhpSession

CreateId

Creates a object id ScavixWDF will create IDs for Renderable objects automatically and ensures uniqueness for the whole session. This method creates such an id based on the given objects classname. It will store it to $obj->_storage_id and return it.

Definition: public function CreateId($obj)

Returns: string The generated object id

Parameters:

  • object $obj Object which needs an id

Delete

Removes an object from the object store.

Definition: public abstract function Delete($id)

Returns: void

Parameters:

  • string $id Key of the object to remove

Exists

Checks if an object exists in the object store.

Definition: public abstract function Exists($id)

Returns: bool true or false

Parameters:

  • string $id Key of the object to check for

GenerateSessionId

Generates a secure session id See http://www.php-security.org/2010/05/09/mops-submission-04-generating-unpredictable-session-ids-and-hashes/index.html#more-204

Definition: public function GenerateSessionId($maxLength)

Returns: string Session id

Parameters:

  • int $maxLength Maximum length of resulting id

KeepAlive

Perform a session keep alive.

Definition: public abstract function KeepAlive($request_key)

Returns: void

Parameters:

  • string $request_key Key in the REQUEST variable containing the request_id value

KillAll

Clears the complete object store.

Definition: public abstract function KillAll()

Returns: void

RegenerateId

Regenerates the session id See http://www.php.net/manual/en/function.session-regenerate-id.php

Definition: public function RegenerateId($destroy_old_session=false)

Returns: bool true or false

Parameters:

  • bool $destroy_old_session Whether to delete the old associated session file or not

RequestId

Returns a (new) request id ScavixWDF creates a new ID for every request and passed it to every subsequent AJAX call. This method does the real magic and creates a new request id or returns the current.

Definition: public function RequestId()

Returns: string A new request id or the current one

Restore

Restores an object from the object store.

Definition: public abstract function Restore($id)

Returns: object The restored object

Parameters:

  • string $id Key of the object to restore

Sanitize

Implement to perform sanitations like checking if users IP has changed.

Definition: public abstract function Sanitize()

Returns: void

Store

Store an object into the object store.

Definition: public abstract function Store($obj, $id)

Returns: void

Parameters:

  • object $obj Object to be stored

  • string $id Key to store object under (use create_storage_id if not given)

Update

Ensures object validity Calls store_object for every Renderable object in the object store to ensure that the stored objects really match the serialized ones. This is needed because fields/properties can change after the initial save and our caching will hide that from system.

No need to call this manually, ScavixWDF will do!

Definition: public function Update()

Returns: void

Clone this wiki locally