OXID eShop CE  4.10.7
 All Classes Namespaces Files Functions Variables Pages
oxSession Class Reference
+ Inheritance diagram for oxSession:
+ Collaboration diagram for oxSession:

Public Member Functions

 getId ()
 setId ($sVal)
 setName ($sVal)
 getForcedName ()
 getName ()
 start ()
 getRequestChallengeToken ()
 getSessionChallengeToken ()
 checkSessionChallenge ()
 initNewSession ()
 regenerateSessionId ()
 freeze ()
 destroy ()
 hasVariable ($name)
 setVariable ($name, $value)
 getVariable ($name)
 deleteVariable ($name)
 sid ($blForceSid=false)
 hiddenSid ()
 getBasket ()
 setBasket ($oBasket)
 delBasket ()
 isNewSession ()
 setForceNewSession ()
 isSidNeeded ($sUrl=null)
 isActualSidInCookie ()
 processUrl ($sUrl)
 getRemoteAccessToken ($blGenerateNew=true)
 getBasketReservations ()
 isHeaderSent ()
 isSessionStarted ()
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 __construct ()
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Protected Member Functions

 _initNewSessionChallenge ()
 _sessionStart ()
 _getNewSessionId ($blUnset=true)
 _validateBasket (oxBasket $oBasket)
 _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
 $_blForceNewSession = false
 $_sErrorMsg = null
 $_oBasket = null
 $_oBasketReservations = null
 $_blStarted = false
 $_aRequireSessionWithParams
 $_blSidNeeded = null
 $_aPersistentParams = array("actshop", "lang", "currency", "language", "tpllanguage")

Static Protected Attributes

static $_blIsNewSession = false
static $_oUser = null
- Static Protected Attributes inherited from oxSuperCfg
static $_oConfig = null
static $_oSession = null
static $_oRights = null
static $_oActUser = null
static $_blIsAdmin = null

Detailed Description

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

Definition at line 11 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 803 of file oxsession.php.

oxSession::_checkCookies (   $sCookieSid,
  $aSessCookieSetOnce 
)
protected

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

Parameters
string$sCookieSidcoockie sid
array$aSessCookieSetOnceif session cookie is set
Returns
bool

Definition at line 931 of file oxsession.php.

oxSession::_checkSid ( )
protected

Checking if this sid is old

Deprecated:
since v5.3.0 (2016-05-24); Implement your own session handler with a module.
Returns
bool

Definition at line 904 of file oxsession.php.

oxSession::_checkUserAgent (   $sAgent,
  $sExistingAgent 
)
protected

Checking user agent

Parameters
string$sAgentcurrent user agent
string$sExistingAgentexisting user agent
Returns
bool

Definition at line 878 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 793 of file oxsession.php.

oxSession::_getBasketName ( )
protected

Returns name of shopping basket.

Returns
string

Definition at line 1010 of file oxsession.php.

oxSession::_getCookieSid ( )
protected

Returns cookie sid value

Returns
string

Definition at line 1025 of file oxsession.php.

oxSession::_getNewSessionId (   $blUnset = true)
protected

Update the current session id with a newly generated one, deletes the old associated session file, frees all session variables.

Parameters
bool$blUnsetif true, calls session_unset [optional]
Returns
string

Definition at line 381 of file oxsession.php.

oxSession::_getRequireSessionWithParams ( )
protected

returns configuration array with info which parameters require session start

Returns
array

Definition at line 1036 of file oxsession.php.

oxSession::_getSessionUseCookies ( )
protected

return cookies usage for sid possibilities

Returns
bool

Definition at line 1081 of file oxsession.php.

oxSession::_initNewSessionChallenge ( )
protected

initialize new session challenge token

Definition at line 281 of file oxsession.php.

oxSession::_isSessionRequiredAction ( )
protected

Tests if current action requires session

Returns
bool

Definition at line 1058 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 838 of file oxsession.php.

oxSession::_isValidRemoteAccessToken ( )
protected

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

Returns
bool

Definition at line 1091 of file oxsession.php.

oxSession::_sessionStart ( )
protected

Initialize session data (calls php::session_start())

Returns
null

Definition at line 291 of file oxsession.php.

oxSession::_setSessionId (   $sSessId)
protected

Sests session id to $sSessId

Parameters
string$sSessIdsesion ID
Returns
null

Definition at line 978 of file oxsession.php.

oxSession::_validateBasket ( oxBasket  $oBasket)
protected

Validate loaded from session basket content. Check for language change.

Parameters
oxBasket$oBasketBasket object loaded from session.
Returns
null

Definition at line 610 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 271 of file oxsession.php.

oxSession::delBasket ( )

Deletes basket session object.

Definition at line 639 of file oxsession.php.

oxSession::deleteVariable (   $name)

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

Parameters
string$nameName of parameter to destroy
Returns
null

Definition at line 503 of file oxsession.php.

oxSession::destroy ( )

Destroys all data registered to a session.

Definition at line 415 of file oxsession.php.

oxSession::freeze ( )

Ends the current session and store session data.

Definition at line 404 of file oxsession.php.

oxSession::getBasket ( )

Returns basket session object.

Returns
oxbasket

Definition at line 578 of file oxsession.php.

oxSession::getBasketReservations ( )

return basket reservations handler object

Returns
oxBasketReservation

Definition at line 1105 of file oxsession.php.

oxSession::getForcedName ( )

Returns forced session id param name

Returns
string

Definition at line 164 of file oxsession.php.

oxSession::getId ( )

Returns session ID

Returns
string

Definition at line 134 of file oxsession.php.

oxSession::getName ( )

Returns session param name

Returns
string

Definition at line 174 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$blGenerateNewShould new token be generated
Returns
string

Definition at line 775 of file oxsession.php.

oxSession::getRequestChallengeToken ( )

retrieve session challenge token from request

Returns
string

Definition at line 244 of file oxsession.php.

oxSession::getSessionChallengeToken ( )

retrieve session challenge token from session

Returns
string

Definition at line 254 of file oxsession.php.

oxSession::getVariable (   $name)

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

Parameters
string$nameName of parameter
Returns
mixed

Definition at line 477 of file oxsession.php.

oxSession::hasVariable (   $name)

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

Parameters
string$nameName to check
Returns
bool

Definition at line 429 of file oxsession.php.

oxSession::hiddenSid ( )

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

Returns
string

Definition at line 560 of file oxsession.php.

oxSession::initNewSession ( )

Assigns new session ID, clean existing data except persistent.

Definition at line 328 of file oxsession.php.

oxSession::isActualSidInCookie ( )

Checks if current session id is the same as in originally received cookie. This method is intended to indicate if new session cookie is to be sent as header from this script execution.

Returns
bool

Definition at line 724 of file oxsession.php.

oxSession::isHeaderSent ( )

Checks if headers were already outputed

Returns
bool

Definition at line 1119 of file oxsession.php.

oxSession::isNewSession ( )

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

Returns
bool

Definition at line 650 of file oxsession.php.

oxSession::isSessionStarted ( )

Returns true if session was started

Returns
bool

Definition at line 1129 of file oxsession.php.

oxSession::isSidNeeded (   $sUrl = null)

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

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

Definition at line 671 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$sUrlurl to append with sid
See Also
oxUtilsUrl::processUrl
Returns
string

Definition at line 742 of file oxsession.php.

oxSession::regenerateSessionId ( )

Regenerates session id

Definition at line 359 of file oxsession.php.

oxSession::setBasket (   $oBasket)

Sets basket session object.

Parameters
object$oBasketbasket object

Definition at line 630 of file oxsession.php.

oxSession::setForceNewSession ( )

Forces starting session and skips checking if session is allowed to start when calling oxSession::start();

Definition at line 659 of file oxsession.php.

oxSession::setId (   $sVal)

Sets session id

Parameters
string$sValid value

Definition at line 144 of file oxsession.php.

oxSession::setName (   $sVal)

Sets session param name

Parameters
string$sValname value

Definition at line 154 of file oxsession.php.

oxSession::setVariable (   $name,
  $value 
)

Sets parameter and its value to global session mixedvar array.

Parameters
string$nameName of parameter to store
mixed$valueValue of parameter
Returns
null

Definition at line 454 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$blForceSidforces sid getter, ignores cookie check (optional)
Returns
string

Definition at line 529 of file oxsession.php.

oxSession::start ( )

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

Definition at line 182 of file oxsession.php.

Member Data Documentation

oxSession::$_aPersistentParams = array("actshop", "lang", "currency", "language", "tpllanguage")
protected

Definition at line 127 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,
'ldtype' => true,
'listorderby' => true,
)

Definition at line 100 of file oxsession.php.

oxSession::$_blForceNewSession = false
protected

Definition at line 62 of file oxsession.php.

oxSession::$_blIsNewSession = false
staticprotected

Definition at line 40 of file oxsession.php.

oxSession::$_blNewSession = false
protected

Definition at line 55 of file oxsession.php.

oxSession::$_blSidNeeded = null
protected

Definition at line 120 of file oxsession.php.

oxSession::$_blStarted = false
protected

Definition at line 90 of file oxsession.php.

oxSession::$_oBasket = null
protected

Definition at line 76 of file oxsession.php.

oxSession::$_oBasketReservations = null
protected

Definition at line 83 of file oxsession.php.

oxSession::$_oUser = null
staticprotected

Definition at line 47 of file oxsession.php.

oxSession::$_sErrorMsg = null
protected

Definition at line 69 of file oxsession.php.

oxSession::$_sForcedPrefix = 'force_'
protected

Definition at line 26 of file oxsession.php.

oxSession::$_sId = null
protected

Definition at line 33 of file oxsession.php.

oxSession::$_sName = 'sid'
protected

Definition at line 19 of file oxsession.php.


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