symfony API

sfSessionStorage Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.1 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.1 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfSessionStorage allows you to store persistent symfony data in the user session.

Inheritence

sfDatabaseSessionStorage  <  sfSessionStorage  <  sfStorage

Method Summary

  • initialize($options)
    Available options:
  • mixed read($key)
    Reads data from this storage.
  • boolean regenerate($destroy)
    Regenerates id that represents this storage.
  • mixed remove($key)
    Removes data from this storage.
  • shutdown()
    Executes the shutdown procedure.
  • write($key, $data)
    Writes data to this storage.

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:


    * session_name: The cookie name (symfony by default)
    * session_id: The session id (null by default)
    * auto_start: Whether to start the session (true by default)
    * session_cookie_lifetime: Cookie lifetime
    * session_cookie_path: Cookie path
    * session_cookie_domain: Cookie domain
    * session_cookie_secure: Cookie secure
    * session_cookie_httponly: Cookie http only (only for PHP >= 5.2)

    The default values for all 'session_cookie_*' options are those returned by the session_get_cookie_params() function

  • (mixed) read ($key) Browse code

    $key A unique key identifying your data

    Reads data from this storage.


    The preferred format for a key is directory style so naming conflicts can be avoided.

    returns Data associated with the key

  • (boolean) regenerate ($destroy) Browse code

    $destroy Destroy session when regenerating?

    Regenerates id that represents this storage.

    returns True if session regenerated, false if error

  • (mixed) remove ($key) Browse code

    $key A unique key identifying your data

    Removes data from this storage.


    The preferred format for a key is directory style so naming conflicts can be avoided.

    returns Data associated with the key

  • shutdown () Browse code

    Executes the shutdown procedure.

  • write ($key, $data) Browse code

    $key A unique key identifying your data
    $data Data associated with your key

    Writes data to this storage.


    The preferred format for a key is directory style so naming conflicts can be avoided.