Package base :: Package includes :: Module session
[hide private]

Module session

source code

User session handling functions.
See Also:
Drupy Homepage, Drupal Homepage
Notes:

Author: Brendon Crawford

Copyright: 2008 Brendon Crawford

Contact: message144 at users dot sourceforge dot net

Version: 0.1

Functions [hide private]
 
open_(save_path, session_name) source code
 
close() source code
 
read(key) source code
 
write(key, value) source code
 
regenerate()
Called when an anonymous user becomes authenticated or vice-versa.
source code
 
count(timestamp=0, anonymous=True)
Counts how many users have sessions.
source code
 
destroy_sid(sid)
Called by PHP session handling with the PHP session ID to end a user's session.
source code
 
destroy_uid(uid)
End a specific user's session
source code
 
gc(lifetime) source code
 
save_session(status=None)
Determine whether to save session data of the current request.
source code
Variables [hide private]
  __version__ = '$Revision: 1 $'
Function Details [hide private]

count(timestamp=0, anonymous=True)

source code 
Counts how many users have sessions. Can count either anonymous sessions, authenticated sessions, or both.
Parameters:
  • int - timestamp A Unix timestamp representing a point of time in the past. The default is 0, which counts all existing sessions.
  • boolean - anonymous True counts only anonymous users. False counts only authenticated users.
Returns:
int The number of users with sessions.

destroy_sid(sid)

source code 
Called by PHP session handling with the PHP session ID to end a user's session.
Parameters:
  • string - sid the session id

destroy_uid(uid)

source code 
End a specific user's session
Parameters:
  • string - uid the user id

save_session(status=None)

source code 
Determine whether to save session data of the current request. This function allows the caller to temporarily disable writing of session data, should the request end while performing potentially dangerous operations, such as manipulating the global user object. See http://drupal.org/node/218104 for usage
Parameters:
  • status - Disables writing of session data when False, (re-)enables writing when True.
Returns:
False if writing session data has been disabled. Otherwise, True.