symfony API

sfDatabaseSessionStorage Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.4 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:

Base class for all sfStorage that uses a sfDatabase object as a storage.

Inheritence

sfMySQLSessionStorage, sfPostgreSQLSessionStorage, sfPDOSessionStorage  <  sfDatabaseSessionStorage  <  sfSessionStorage < sfStorage

Method Summary

Methods inherited from sfSessionStorage

initialize , read , regenerate , remove , shutdown , write

Methods inherited from sfStorage

getOptions , initialize , read , regenerate , remove , shutdown , write , __construct

Method Details

  • initialize ($options) Browse code

    $options An associative array of options

    Available options:


    * db_table: The database table in which session data will be stored
    * database: The sfDatabase object to use
    * db_id_col: The database column in which the session id will be stored (sess_id by default)
    * db_data_col: The database column in which the session data will be stored (sess_data by default)
    * db_time_col: The database column in which the session timestamp will be stored (sess_time by default)

  • (boolean) regenerate ($destroy) Browse code

    $destroy Destroy session when regenerating?

    Regenerates id that represents this storage.

    returns True if session regenerated, false if error

  • (boolean) sessionClose () Browse code

    Closes a session.

    returns true, if the session was closed, otherwise false

  • (bool) sessionDestroy ($id) Browse code

    $id A session ID

    Destroys a session.

    returns true, if the session was destroyed, otherwise an exception is thrown

    throws DatabaseException If the session cannot be destroyed

  • (bool) sessionGC ($lifetime) Browse code

    $lifetime The lifetime of a session

    Cleans up old sessions.

    returns true, if old sessions have been cleaned, otherwise an exception is thrown

    throws DatabaseException If any old sessions cannot be cleaned

  • (boolean) sessionOpen ($path, $name) Browse code

    $path (ignored)
    $name (ignored)

    Opens a session.

    returns true, if the session was opened, otherwise an exception is thrown

    throws DatabaseException If a connection with the database does not exist or cannot be created

  • (bool) sessionRead ($id) Browse code

    $id A session ID

    Reads a session.

    returns true, if the session was read, otherwise an exception is thrown

    throws DatabaseException If the session cannot be read

  • (bool) sessionWrite ($id, $data) Browse code

    $id A session ID
    $data A serialized chunk of session data

    Writes session data.

    returns true, if the session was written, otherwise an exception is thrown

    throws DatabaseException If the session data cannot be written

  • shutdown () Browse code

    Executes the shutdown procedure.