oxSession Class Reference

Inheritance diagram for oxSession:

Inheritance graph
[legend]
Collaboration diagram for oxSession:

Collaboration graph
[legend]

List of all members.


Detailed Description

Session manager. Performs session managing function, such as variables deletion, initialisation and other session functions.

Public Member Functions

 getId ()
 setId ($sVal)
 setName ($sVal)
 getName ()
 start ()
 initNewSession ()
 freeze ()
 destroy ()
 url ($url)
 sid ()
 hiddenSid ()
 getBasket ()
 setBasket ($oBasket)
 delBasket ()
 isNewSession ()

Static Public Member Functions

static getInstance ()
static hasVar ($name)
static setVar ($name, $value)
static getVar ($name)
static deleteVar ($name)

Protected Member Functions

 _allowSessionStart ()
 _checkMandatoryCookieSupport ($sClass, $sFunction)
 _isSwappedClient ()
 _checkUserAgent ($sAgent, $sExistingAgent)
 _checkSid ()
 _checkCookies ($sCookieSid, $aSessCookieSetOnce)
 _setSessionId ($sSessId)
 _getBasketName ()
 _getCookieSid ()

Protected Attributes

 $_sName = 'sid'
 $_sId = null
 $_blNewSession = false
 $_sErrorMsg = null
 $_aRequireCookiesInFncs
 $_aPersistentParams = array("actshop", "lang", "currency", "language", "tpllanguage")

Static Protected Attributes

static $_blIsNewSession = false
static $_instance = null
static $_oUser = null

Private Attributes

 $name = 'sid'
 $id

Member Function Documentation

static oxSession.getInstance (  )  [static]

get oxSession object instance (create if needed)

Returns:
oxSession

oxSession.getId (  ) 

Returns session ID

Returns:
string

oxSession.setId ( sVal  ) 

Sets session id

Parameters:
unknown_type $sVal

oxSession.setName ( sVal  ) 

Sets session param name

Parameters:
string $sVal

oxSession.getName (  ) 

Returns session param name

Returns:
string

oxSession.start (  ) 

Starts shop session, generates unique session ID, extracts user IP.

Exceptions:
oxSystemComponentException,oxCookieException 
Returns:
null

oxSession.initNewSession (  ) 

Assigns new session ID, clean existing data except persistent.

Returns:
null

oxSession.freeze (  ) 

Ends the current session and store session data.

Returns:
null

oxSession.destroy (  ) 

Destroys all data registered to a session.

Returns:
null

static oxSession.hasVar ( name  )  [static]

Checks if variable is set in session. Returns true on success.

Parameters:
string $name Name to check
Returns:
bool

static oxSession.setVar ( name,
value 
) [static]

Sets parameter and its value to global session mixedvar array.

Parameters:
string $name Name of parameter to store
mixed $value Value of parameter
Returns:
null

static oxSession.getVar ( name  )  [static]

IF available returns value of parameter, stored in session array.

Parameters:
string $name Name of parameter
Returns:
mixed

static oxSession.deleteVar ( name  )  [static]

Destroys a single element (passed to method) of an session array.

Parameters:
string $name Name of parameter to destroy
Returns:
null

oxSession.url ( url  ) 

Append URL with session information parameter.

Parameters:
string $url Current url
Returns:
string

oxSession.sid (  ) 

Returns string prefix to URL with session ID parameter. In some cases (if client is robot, such as Google) adds parameter shp, to identify, witch shop is currently running.

Returns:
string

oxSession.hiddenSid (  ) 

Forms input ("hidden" type) to pass session ID after submitting forms.

Returns:
string

oxSession.getBasket (  ) 

Returns basket session object.

Returns:
oxbasket

oxSession.setBasket ( oBasket  ) 

Sets basket session object.

Parameters:
object $oBasket basket object
Returns:
null

oxSession.delBasket (  ) 

Deletes basket session object.

Returns:
null

oxSession.isNewSession (  ) 

Indicates if setting of session id is executed in this script.

Returns:
bool

oxSession._allowSessionStart (  )  [protected]

Checks if we can start new session. Returns bool success status

Returns:
bool

oxSession._checkMandatoryCookieSupport ( sClass,
sFunction 
) [protected]

Checks for mandatory cookie support. Return true if the check is succseful. False means some problem occured - user has no cookies, but they are required.

Returns:
null

oxSession._isSwappedClient (  )  [protected]

Saves various visitor parameters and compares with current data. Returns true if any change is detected. Using this method we can detect different visitor with same session id.

Returns:
bool

oxSession._checkUserAgent ( sAgent,
sExistingAgent 
) [protected]

Checking user agent

Parameters:
string $sAgent current user agent
string $sExistingAgent existing user agent
Returns:
bool

oxSession._checkSid (  )  [protected]

Checking by timeout ( 60 minutes inactive, then kick him ) Global session Timeout in oxconfig.StartupDatabase is set to 1 hour

Returns:
bool Checking if this sid is old

bool

oxSession._checkCookies ( sCookieSid,
aSessCookieSetOnce 
) [protected]

Check for existing cookie. Cookie info is dropped from time to time.

Parameters:
string $sCookieSid coockie sid
array $aSessCookieSetOnce if session cookie is set
Returns:
bool

oxSession._setSessionId ( sSessId  )  [protected]

Sests session id to $sSessId

Parameters:
string $sSessId sesion ID
Returns:
null

oxSession._getBasketName (  )  [protected]

Returns name of shopping basket.

Returns:
string

oxSession._getCookieSid (  )  [protected]

Returns cookie sid value

Returns:
string


Member Data Documentation

oxSession.$name = 'sid' [private]

oxSession.$_sName = 'sid' [protected]

oxSession.$_sId = null [protected]

oxSession.$id [private]

oxSession.$_blIsNewSession = false [static, protected]

oxSession.$_instance = null [static, protected]

Singleton instance keeper.

oxSession.$_oUser = null [static, protected]

oxSession.$_blNewSession = false [protected]

oxSession.$_sErrorMsg = null [protected]

oxSession.$_aRequireCookiesInFncs [protected]

Initial value:

 array( 'register' => null,
                                                'account' => null,
                                                             'tobasket',
                                                             'login_noredirect'
                                                )

oxSession.$_aPersistentParams = array("actshop", "lang", "currency", "language", "tpllanguage") [protected]

Session params to be kept even after session timeout


The documentation for this class was generated from the following file:

Generated on Wed Oct 29 23:45:53 2008 for OXID eShop CE by  doxygen 1.5.5