Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

oxSession Class Reference

Inheritance diagram for oxSession:
Collaboration diagram for oxSession:

List of all members.

Public Member Functions

 getId ()
 setId ($sVal)
 setName ($sVal)
 getForcedName ()
 getName ()
 start ()
 getRequestChallengeToken ()
 getSessionChallengeToken ()
 checkSessionChallenge ()
 initNewSession ()
 freeze ()
 destroy ()
 url ($sUrl)
 sid ($blForceSid=false)
 hiddenSid ()
 getBasket ()
 setBasket ($oBasket)
 delBasket ()
 isNewSession ()
 isSidNeeded ($sUrl=null)
 processUrl ($sUrl)
 getRemoteAccessToken ($blGenerateNew=true)
 getBasketReservations ()

Static Public Member Functions

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

Protected Member Functions

 _initNewSessionChallenge ()
 _sessionStart ()
 _forceSessionStart ()
 _allowSessionStart ()
 _isSwappedClient ()
 _checkUserAgent ($sAgent, $sExistingAgent)
 _checkSid ()
 _checkCookies ($sCookieSid, $aSessCookieSetOnce)
 _setSessionId ($sSessId)
 _getBasketName ()
 _getCookieSid ()
 _getRequireSessionWithParams ()
 _isSessionRequiredAction ()
 _getSessionUseCookies ()
 _isValidRemoteAccessToken ()

Protected Attributes

 $_sName = 'sid'
 $_sForcedPrefix = 'force_'
 $_sId = null
 $_blNewSession = false
 $_sErrorMsg = null
 $_oBasket = null
 $_oBasketReservations = null
 $_aRequireCookiesInFncs = array()
 $_aRequireSessionWithParams
 $_blSidNeeded = null
 $_aPersistentParams = array("actshop", "lang", "currency", "language", "tpllanguage")

Static Protected Attributes

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

Detailed Description

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

Definition at line 15 of file oxsession.php.


Member Function Documentation

oxSession._allowSessionStart (  )  [protected]

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

Returns:
bool

Definition at line 755 of file oxsession.php.

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

Definition at line 866 of file oxsession.php.

oxSession._checkSid (  )  [protected]

Checking if this sid is old

Returns:
bool

Definition at line 842 of file oxsession.php.

oxSession._checkUserAgent ( sAgent,
sExistingAgent 
) [protected]

Checking user agent

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

Definition at line 824 of file oxsession.php.

oxSession._forceSessionStart (  )  [protected]

Returns true if its not search engine and config option blForceSessionStart = 1/true or _GET parameter "su" (suggested user id) is set.

Returns:
bool

Definition at line 745 of file oxsession.php.

oxSession._getBasketName (  )  [protected]

Returns name of shopping basket.

Returns:
string

Definition at line 939 of file oxsession.php.

oxSession._getCookieSid (  )  [protected]

Returns cookie sid value

Returns:
string

Definition at line 953 of file oxsession.php.

oxSession._getRequireSessionWithParams (  )  [protected]

returns configuration array with info which parameters require session start

Returns:
array

Definition at line 964 of file oxsession.php.

oxSession._getSessionUseCookies (  )  [protected]

return cookies usage for sid possibilities

Returns:
bool

Definition at line 1016 of file oxsession.php.

oxSession._initNewSessionChallenge (  )  [protected]

initialize new session challenge token

Returns:
null

Definition at line 302 of file oxsession.php.

oxSession._isSessionRequiredAction (  )  [protected]

Tests if current action requires session

Returns:
bool

Definition at line 984 of file oxsession.php.

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

Definition at line 786 of file oxsession.php.

oxSession._isValidRemoteAccessToken (  )  [protected]

Checks if token supplied over 'rtoken' parameter match remote accecss session token.

Returns:
bool

Definition at line 1026 of file oxsession.php.

oxSession._sessionStart (  )  [protected]

Initialize session data (calls php.session_start())

Returns:
null

Definition at line 312 of file oxsession.php.

oxSession._setSessionId ( sSessId  )  [protected]

Sests session id to $sSessId

Parameters:
string $sSessId sesion ID
Returns:
null

Definition at line 908 of file oxsession.php.

oxSession.checkSessionChallenge (  ) 

check for CSRF, returns true, if request (get/post) token maches session saved var false, if CSRF is possible

Returns:
bool

Definition at line 291 of file oxsession.php.

oxSession.delBasket (  ) 

Deletes basket session object.

Returns:
null

Definition at line 621 of file oxsession.php.

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

Definition at line 473 of file oxsession.php.

oxSession.destroy (  ) 

Destroys all data registered to a session.

Returns:
null

Definition at line 386 of file oxsession.php.

oxSession.freeze (  ) 

Ends the current session and store session data.

Returns:
null

Definition at line 373 of file oxsession.php.

oxSession.getBasket (  ) 

Returns basket session object.

Returns:
oxbasket

Definition at line 584 of file oxsession.php.

oxSession.getBasketReservations (  ) 

return basket reservations handler object

Returns:
oxBasketReservation

Definition at line 1041 of file oxsession.php.

oxSession.getForcedName (  ) 

Returns forced session id param name

Returns:
string

Definition at line 187 of file oxsession.php.

oxSession.getId (  ) 

Returns session ID

Returns:
string

Definition at line 153 of file oxsession.php.

static oxSession.getInstance (  )  [static]

get oxSession object instance (create if needed)

Returns:
oxSession

Reimplemented in oxOpenIdSession.

Definition at line 135 of file oxsession.php.

oxSession.getName (  ) 

Returns session param name

Returns:
string

Definition at line 197 of file oxsession.php.

oxSession.getRemoteAccessToken ( blGenerateNew = true  ) 

Returns remote access key. With this key (called over "remotekey" URL parameter) and session id (sid parameter) you can access session from another client. The key is generated once per session after the first request.

Parameters:
bool $blGenerateNew Should new token be generated
Returns:
string

Definition at line 727 of file oxsession.php.

oxSession.getRequestChallengeToken (  ) 

retrieve session challenge token from request

Returns:
string

Definition at line 265 of file oxsession.php.

oxSession.getSessionChallengeToken (  ) 

retrieve session challenge token from session

Returns:
string

Definition at line 275 of file oxsession.php.

static oxSession.getVar ( name  )  [static]

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

Parameters:
string $name Name of parameter
Returns:
mixed

Definition at line 447 of file oxsession.php.

static oxSession.hasVar ( name  )  [static]

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

Parameters:
string $name Name to check
Returns:
bool

Definition at line 400 of file oxsession.php.

oxSession.hiddenSid (  ) 

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

Returns:
string

Definition at line 572 of file oxsession.php.

oxSession.initNewSession (  ) 

Assigns new session ID, clean existing data except persistent.

Returns:
null

Definition at line 337 of file oxsession.php.

oxSession.isNewSession (  ) 

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

Returns:
bool

Definition at line 632 of file oxsession.php.

oxSession.isSidNeeded ( sUrl = null  ) 

Checks if cookies are not available. Returns TRUE of sid needed

Parameters:
string $sUrl if passed domain does not match current - returns true (optional)
Returns:
bool

Definition at line 644 of file oxsession.php.

oxSession.processUrl ( sUrl  ) 

Appends url with session ID, but only if oxSession._isSidNeeded() returns true Direct usage of this method to retrieve end url result is discouraged - instead see oxUtilsUrl.processUrl

Parameters:
string $sUrl url to append with sid
See also:
oxUtilsUrl.processUrl
Returns:
string

Definition at line 695 of file oxsession.php.

oxSession.setBasket ( oBasket  ) 

Sets basket session object.

Parameters:
object $oBasket basket object
Returns:
null

Definition at line 610 of file oxsession.php.

oxSession.setId ( sVal  ) 

Sets session id

Parameters:
string $sVal id value
Returns:
null

Definition at line 165 of file oxsession.php.

oxSession.setName ( sVal  ) 

Sets session param name

Parameters:
string $sVal name value
Returns:
null

Definition at line 177 of file oxsession.php.

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

Definition at line 424 of file oxsession.php.

oxSession.sid ( blForceSid = false  ) 

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.

Parameters:
bool $blForceSid forces sid getter, ignores cookie check (optional)
Returns:
string

Definition at line 541 of file oxsession.php.

oxSession.start (  ) 

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

Returns:
null

Definition at line 207 of file oxsession.php.

oxSession.url ( sUrl  ) 

Append URL with session information parameter.

Parameters:
string $sUrl Current url
Deprecated:
See also:
oxUtilsUrl.processUrl()
Returns:
string

Definition at line 500 of file oxsession.php.


Member Data Documentation

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

Definition at line 128 of file oxsession.php.

oxSession.$_aRequireCookiesInFncs = array() [protected]

Definition at line 92 of file oxsession.php.

oxSession.$_aRequireSessionWithParams [protected]
Initial value:
 array(
                       'cl' => array (
                            'register' => true,
                            'account'  => true,
                           ),
                       'fnc' => array (
                           'tobasket'         => true,
                           'login_noredirect' => true,
                           'tocomparelist'    => true,
                           ),
                       '_artperpage' => true,
                       'listorderby' => true,
    )

Definition at line 102 of file oxsession.php.

oxSession.$_blIsNewSession = false [static, protected]

Definition at line 42 of file oxsession.php.

oxSession.$_blNewSession = false [protected]

Definition at line 61 of file oxsession.php.

oxSession.$_blSidNeeded = null [protected]

Definition at line 121 of file oxsession.php.

oxSession.$_instance = null [static, protected]

Singleton instance keeper.

Reimplemented in oxOpenIdSession.

Definition at line 47 of file oxsession.php.

oxSession.$_oBasket = null [protected]

Definition at line 75 of file oxsession.php.

oxSession.$_oBasketReservations = null [protected]

Definition at line 82 of file oxsession.php.

oxSession.$_oUser = null [static, protected]

Definition at line 53 of file oxsession.php.

oxSession.$_sErrorMsg = null [protected]

Definition at line 68 of file oxsession.php.

oxSession.$_sForcedPrefix = 'force_' [protected]

Definition at line 29 of file oxsession.php.

oxSession.$_sId = null [protected]

Definition at line 35 of file oxsession.php.

oxSession.$_sName = 'sid' [protected]

Definition at line 22 of file oxsession.php.


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