This is an old revision of the document!


Internals: SympaSession.pm

This module provides objects to create, load, store and remove sessions

new()

Creates an object Session.

Parameters

  • robot : sessions are related to a specific robot
  • cookie : the sympa_session cookie value which is a random value without any semantic

If cookie is undef or not in session_table, new() will create a new session by allocation of a random. If cookie is defined and found in the sympa_session table new check if the session is valid (mainly : the http client host (remote_addr) must be the same as the host that initialyse the session). FIXME : may be usefull to ignore old sessions. If the session is valid it is loaded : load() .

load()

  • load() read session attributes from session_table using cookie value as the primary key. All attributes are returned in a hash. Load() use tools::string_2_hash in order to convert the varchar data_session column in a set of vars <var>=“<value>”;<var>=“<value>”;

store()

  • store() store session attributes from curernt objet into session_table. Store update the date_session attributes which is used by &SympaSession::purge_session() to remove old sessions.

store() convert a set of vars into a data_session string which can be stored in the database using tools::hash_2_string

()

  • internals/internals-session.1187880243.txt.gz
  • Last modified: 2007/08/23 17:26
  • (external edit)