phpDocumentor util
[ class tree: util ] [ index: util ] [ all elements ]

Class: Session

Source Location: /myphp-1.9/myphp-1.9-util/html/component/Session.php

Class Session

Method Summary
Session   Session()   Constructor
void   addHtml()  
boolean   decode()   Decodes the session data
void   display()   Display html
String   encode()   Returns a string with the encoded session data
int   getCacheExpire()   Returns or sets the cache expire time
String   getCacheLimiter()   Returns the name of the current cache limiter
array   getCookieParams()   Returns an array with the current session cookie information lifetime, path, domain, security...
void   getHtml()  
String   getId()   Returns the session ID and set the current id
String   getModuleName()   Returns the name of the current session module
String   getName()   Returns the name of the current session
boolean   isRegistered()   Returns true, if a variable with the $name is registrered
void   reset()   Unregisters (forgets) all variables currently registred
int   setCacheExpire()   Set the cache expire time
String   setCacheLimiter()   Set the name of the current cache limiter
void   setCookieParams()   Sets the cookie parameters
String   setId()   Set a new session id and return the session ID
String   setModuleName()   Set a new module name for the current session and return the name
String   setName()   Set the name of the current session and return the name
void   setSaveHandler()   Sets the user-level session storage functions
boolean   start()   Creates a session or resumes the current one based on

[ Top ]
Methods
Constructor Session  [line 39]

  Session Session( )

Constructor



[ Top ]
addHtml  [line 328]

  void addHtml( )



[ Top ]
decode  [line 76]

  boolean decode( String $data  )

Decodes the session data

Usage: $rc = Session::decode($html);

Parameters:
String   $data:  The data to decode

API Tags:
Return:  TRUE on success, FALSE on failure
Static:  


[ Top ]
display  [line 340]

  void display( )

Display html

  1. Usage:
  2. Session::display();


API Tags:
Static:  


[ Top ]
encode  [line 114]

  String encode( )

Returns a string with the encoded session data

Usage: $html = Session::encode();


API Tags:
Return:  The encoded data
Static:  


[ Top ]
getCacheExpire  [line 88]

  int getCacheExpire( [String $time = '']  )

Returns or sets the cache expire time

Usage: $t = Session::getCacheExpire($time); NOTE: Must be called before Session::start()

Parameters:
String   $time:  The new expire time

API Tags:
Return:  The expiration time
Static:  


[ Top ]
getCacheLimiter  [line 49]

  String getCacheLimiter( [String $name = '']  )

Returns the name of the current cache limiter

Usage: $html = Session::getCacheLimiter();

Parameters:
String   $name:  The name of the cache limiter

API Tags:
Return:  The name
Static:  


[ Top ]
getCookieParams  [line 125]

  array getCookieParams( )

Returns an array with the current session cookie information lifetime, path, domain, security...

Usage: $rc = Session::getCookieParams();


API Tags:
Return:  The cookie param info
Static:  


[ Top ]
getHtml  [line 320]

  void getHtml( )



[ Top ]
getId  [line 175]

  String getId( [String $id = '']  )

Returns the session ID and set the current id

NOTE: The Session::start() is called, if no id is found Usage: $html = Session::getId(); If GET/POST REQUEST_SID is specified, replace it with the current sid

Parameters:
String   $id:  The ID to replace current session id

API Tags:
Return:  The session id
Static:  


[ Top ]
getModuleName  [line 226]

  String getModuleName( [String $name = '']  )

Returns the name of the current session module

Usage: $html = Session::getModuleName($name);

Parameters:
String   $name:  The name of a new module to use

API Tags:
Return:  The session module name
Static:  


[ Top ]
getName  [line 253]

  String getName( [String $name = '']  )

Returns the name of the current session

in the current session Usage: $rc = Session::getName();

Parameters:
String   $name:  The name to change

API Tags:
Return:  The name of the session
Static:  


[ Top ]
isRegistered  [line 162]

  boolean isRegistered( String $name  )

Returns true, if a variable with the $name is registrered

in the current session Usage: $rc = Session::isRegistered($name);

Parameters:
String   $name:  The name to check

API Tags:
Return:  TRUE on success, FALSE on failure
Static:  


[ Top ]
reset  [line 280]

  void reset( )

Unregisters (forgets) all variables currently registred

Usage: Session::reset(); NOTE: Why does function unset() {...} fails ? Have to use function reset() {...} instead Could be that the unset() is a predefined function?


API Tags:
Static:  


[ Top ]
setCacheExpire  [line 104]

  int setCacheExpire( mixed $time, date $time,  )

Set the cache expire time

Usage: $t = Session::setCacheExpire($time); NOTE: Must be called before Session::start()

Parameters:
date   $time,:  The new expire time

API Tags:
Return:  The expiration time
Static:  


[ Top ]
setCacheLimiter  [line 65]

  String setCacheLimiter( String $name  )

Set the name of the current cache limiter

NOTE: Must be called before Session::start(); Usage: Session::setCacheLimiter($name);

Parameters:
String   $name:  The name. i.e. private_no_expire,nocache, public, private

API Tags:
Return:  The new cache name
Static:  


[ Top ]
setCookieParams  [line 138]

  void setCookieParams( String $lifetime, [String $path = ''], [String $domain = ''], [String $security = '']  )

Sets the cookie parameters

Usage: String Session::setCookieParams($lifetime,$path,$domain);

Parameters:
String   $lifetime:  The lifetime of the cookie
String   $path:  The path, Remember to add '/' in the end
String   $domain:  The domain
String   $security:  The security flag, boolean

API Tags:
Static:  


[ Top ]
setId  [line 215]

  String setId( String $id  )

Set a new session id and return the session ID

Usage: $html = Session::setId($id);

Parameters:
String   $id:  The new ID to replace current session id

API Tags:
Return:  The session id
Static:  


[ Top ]
setModuleName  [line 241]

  String setModuleName( String $name  )

Set a new module name for the current session and return the name

Usage: $html = Session::setModuleName($name);

Parameters:
String   $name:  The new module name to replace current session module name

API Tags:
Return:  The session module name
Static:  


[ Top ]
setName  [line 268]

  String setName( String $name  )

Set the name of the current session and return the name

Usage: $html = Session::setName($name);

Parameters:
String   $name:  The new name to replace current session name

API Tags:
Return:  The session name
Static:  


[ Top ]
setSaveHandler  [line 316]

  void setSaveHandler( String $open, String $close, String $read, String $write, String $destroy, String $gc  )

Sets the user-level session storage functions

Usage: Session::setSaveHandler($open,$close,$read,$write,$destroy,$gc); NOTE: The $session.save_handler=$user in php.ini

Parameters:
String   $open:  The open handler
String   $close:  The close handler
String   $read:  The read handler
String   $write:  The write handler
String   $destroy:  The destroy handler
String   $gc:  The garbage collector handler

API Tags:
Static:  


[ Top ]
start  [line 291]

  boolean start( )

Creates a session or resumes the current one based on

the session id being passed via GET or a cookie Usage: $html = Session::start();


API Tags:
Return:  TRUE always, never fails
Static:  


[ Top ]

Documentation generated on Thu, 22 Dec 2005 17:17:17 +0100 by phpDocumentor 1.3.0RC3