Class Ismo_Core_Session

Description

This class represents a session, a way to contain information between multiple requests from one client.

It will make it easier to store and retrieve things and also create and check for the existence of a session. So it's mostly a convinience class. If a session is available at construction time (i.e. when the constructor is called) the session will automatically be resumed.

Located in /Session.php (line 41)


	
			
Variable Summary
Method Summary
Ismo_Core_Session Ismo_Core_Session ()
void create ()
void destroy ()
mixed get (string $key)
boolean has (string $key)
boolean hasSession ()
boolean isSessionAvailable ()
void put (string $key, mixed $data)
boolean remove (string $key)
Variables
boolean $_sessionIndicator = FALSE (line 49)

Indicates if a session has been created/resumed or not.

  • access: private
Methods
Constructor Ismo_Core_Session (line 62)

The constructor. Resumes a session if a session is available.

Checks to see if a session is available, if one is. It will be resumed. Otherwise nothing is done. New sessions have to be created manually.

  • access: public
Ismo_Core_Session Ismo_Core_Session ()
create (line 143)

Starts a new session.

  • access: public
void create ()
destroy (line 160)

Destroys the session.

Destroys the current session, all the data stored in the session will be lost. To clarify, it also unsets all the global variables stored in _SESSION.

  • access: public
void destroy ()
get (line 201)

Gets something previously stored in the session.

Tries to retrive an object earlier stored in the session. If no object with the given key name exists, NULL is returned.

  • return: the data earlier stored in the session or NULL if no value with the given key exists
  • access: public
mixed get (string $key)
  • string $key: the identifier of the stored date
getRequestedSessionId (line 102)

Returns the session id in used for the current session.

If there is a current session the id for that one is returned. I.e. this is the id the client gave which identifies its session. If there is no session NULL is returned.

  • return: the session id as a string or NULL if there is no current session
  • access: public
string getRequestedSessionId ()
has (line 247)

Checks if something is available in the session with the asked for key.

  • return: indicating whether it's available or not
  • access: public
boolean has (string $key)
  • string $key: the key to check for
hasSession (line 183)

Checks if this IsmoSession instance has a valid client session or not.

To clarify, a IsmoSession instance can exist but no client session. The IsmoSession class just represents the session if it's available, if it's not available the class represents an non-existent session. And it has a method to create a session.

boolean hasSession ()
isRequestedSessionIdFromCookie (line 116)

Checks if the session id came from a cookie.

  • return: indicating whether the session id came from a cookie or not
  • access: public
boolean isRequestedSessionIdFromCookie ()
isRequestedSessionIdFromUrl (line 130)

Checks if the session id came from the URL.

  • return: indicating whether the session id came from the URL or not
  • access: public
boolean isRequestedSessionIdFromUrl ()
isSessionAvailable (line 287)

Checks if a session is available for resuming.

By checking if there is a cookie or a get/post parameter set which match the session name identifier we can judge if there is a session available for resuming.

  • return: indicating whether there is a session available for resuming or not
  • access: public
boolean isSessionAvailable ()
put (line 225)

Puts something to be saved in the session.

Stores something in the session for later retrieval, as long as the session is still alive. If the session "dies" or is "ended" all the data associated with the session is lost.

If there is no active/current session a new one is started. If there is already previous saved object with the same key it's overwritten.

  • access: public
void put (string $key, mixed $data)
  • string $key: the identifier of the object
  • mixed $data: the data/object
remove (line 265)

Removes the stored object from the session.

If an object with the given key exists in the session it's removed and true is returned otherwise false is returned.

  • return: indicating whether it was removed or not
  • access: public
boolean remove (string $key)
  • string $key: the identifier of the object

Documentation generated on Mon, 14 Jun 2004 11:59:36 +0200 by phpDocumentor 1.3.0RC3