vB_Session_WebApi
extends vB_Session_Web
in package
This class is used by collapsed interface and behaves exactly as a web session without cookies
Table of Contents
Properties
- $created : bool
- Whether the session was created or existed previously
Methods
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- clearChannelPerms() : mixed
- clearUserInfo() : mixed
- Clear user cached info. Primarily needed for cleaning cache in memory.
- createSession() : mixed
- createSessionNew() : mixed
- Create a session for this page load
- delete() : mixed
- Deletes the session from the session store.
- doLastVisitUpdate() : array<string|int, mixed>
- Updates the last visit and last activity times for guests and registered users (differently).
- doRememberMe() : mixed
- fetch_sessionhash() : string
- Fetches a valid sessionhash value, not necessarily the one tied to this session.
- fetch_userinfo() : array<string|int, mixed>
- Returns appropriate user info for the owner of this session.
- fetch_userinfo_value() : mix
- Returns appropriate value from the user info array for the owner of this session.
- fetchCpsessionHash() : string
- Create new cpsession for the user and insert it into database or fetch current existing one
- finalize() : mixed
- get() : mixed
- Gets a session variable.
- getAllVars() : array<string|int, mixed>
- Returns an array with all session vars
- getChannelPerms() : mixed
- getNewSession() : vB_Session
- Returns a new session of the type specified by defined constants
- getRememberMeToken() : mixed
- getSession() : mixed
- getSessionIdHash() : string
- Returns the sessionIdHash
- getVbUrlScheme() : string
- Get the current url scheme- http or https
- isCreated() : bool
- Returns whether the session was created
- loadLanguage() : mixed
- Loads basic language information
- processLogout() : mixed
- Process any additionl bookkeeping on logout
- processNewLogin() : mixed
- Process any additionl bookkeeping on login
- save() : mixed
- Saves the session into the database by inserting it or updating an existing one.
- set() : mixed
- Sets a session variable and updates the change list.
- setChannelPerms() : mixed
- setCpsessionHash() : mixed
- validateCpsession() : bool
- Validate cpsession
Properties
$created
Whether the session was created or existed previously
public
bool
$created
= \false
Methods
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
clearChannelPerms()
public
clearChannelPerms() : mixed
clearUserInfo()
Clear user cached info. Primarily needed for cleaning cache in memory.
public
clearUserInfo() : mixed
createSession()
public
static createSession([mixed $sessionhash = '' ][, mixed $userid = 0 ][, mixed $password = '' ]) : mixed
Parameters
- $sessionhash : mixed = ''
- $userid : mixed = 0
- $password : mixed = ''
createSessionNew()
Create a session for this page load
public
static createSessionNew(string $sessionhash[, array<string|int, mixed> $restoreSessionInfo = array() ][, mixed $deferRememberMe = false ]) : mixed
Should only be called from the Request code. Will use a reexisting session that matches the session hash
Parameters
- $sessionhash : string
-
-- the token given to the client for session handling. If the client has this token they can use the session.
- $restoreSessionInfo : array<string|int, mixed> = array()
-
-- Information to handle "remember me" logic.
- remembermetoken -- Token value for "remember me". Stored in the "password" cookie for legacy reasons. There are so special values to indicate that we should reauthentic via a method other than the internal vB remember me system.
- userid -- user we are remembering
- fbsr_{appid} (optional) -- Only valid if facebook is enabled, and only used if "remembermetoken" is "facebook".
- $deferRememberMe : mixed = false
delete()
Deletes the session from the session store.
public
delete() : mixed
Deletes records matching the session's sessionhash. If there is an apiaccesstoken then sessions matching that are also deleted.
Will have no effect and no error if the session doesn't exist.
Sets the session to "not created", but does not otherwise affect the session object.
doLastVisitUpdate()
Updates the last visit and last activity times for guests and registered users (differently).
public
doLastVisitUpdate([mixed $lastvisit = 0 ][, mixed $lastactivity = 0 ]) : array<string|int, mixed>
Last visit is set to the last activity time (before it's updated) only when a certain time has lapsed. Last activity is always set to the specified time.
Parameters
- $lastvisit : mixed = 0
- $lastactivity : mixed = 0
Return values
array<string|int, mixed> —Updated values for setting cookies (guest only)
doRememberMe()
public
doRememberMe(mixed $restoreSessionInfo[, mixed $gotsession = true ]) : mixed
Parameters
- $restoreSessionInfo : mixed
- $gotsession : mixed = true
fetch_sessionhash()
Fetches a valid sessionhash value, not necessarily the one tied to this session.
public
fetch_sessionhash() : string
Return values
string —32-character sessionhash
fetch_userinfo()
Returns appropriate user info for the owner of this session.
public
& fetch_userinfo() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of user information.
fetch_userinfo_value()
Returns appropriate value from the user info array for the owner of this session.
public
& fetch_userinfo_value(mixed $value) : mix
Parameters
- $value : mixed
Return values
mix —value of user information.
fetchCpsessionHash()
Create new cpsession for the user and insert it into database or fetch current existing one
public
fetchCpsessionHash([bool $renew = false ]) : string
Parameters
- $renew : bool = false
-
Whether to renew cpsession hash (Create a new one and drop the old one)
Tags
Return values
string —The new cpsession hash
finalize()
public
finalize([mixed $styleid = 0 ][, mixed $languageid = 0 ]) : mixed
Parameters
- $styleid : mixed = 0
- $languageid : mixed = 0
get()
Gets a session variable.
public
get(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —- Value of the key, NULL if not found
getAllVars()
Returns an array with all session vars
public
getAllVars() : array<string|int, mixed>
Return values
array<string|int, mixed>getChannelPerms()
public
getChannelPerms(mixed $key) : mixed
Parameters
- $key : mixed
getNewSession()
Returns a new session of the type specified by defined constants
public
static getNewSession(vB_dB_Assertor &$dBAssertor, vB_Datastore &$datastore, array<string|int, mixed> &$config[, string $sessionhash = '' ][, int $userid = 0 ][, string $password = '' ][, int $styleid = 0 ][, int $languageid = 0 ]) : vB_Session
Parameters
- $dBAssertor : vB_dB_Assertor
- $datastore : vB_Datastore
- $config : array<string|int, mixed>
- $sessionhash : string = ''
- $userid : int = 0
- $password : string = ''
- $styleid : int = 0
- $languageid : int = 0
Tags
Return values
vB_SessiongetRememberMeToken()
public
getRememberMeToken() : mixed
getSession()
public
static getSession(mixed $userId[, mixed $sessionHash = '' ][, mixed $dBAssertor = null ][, mixed $datastore = null ][, mixed $config = null ]) : mixed
Parameters
- $userId : mixed
- $sessionHash : mixed = ''
- $dBAssertor : mixed = null
- $datastore : mixed = null
- $config : mixed = null
getSessionIdHash()
Returns the sessionIdHash
public
getSessionIdHash() : string
Return values
stringgetVbUrlScheme()
Get the current url scheme- http or https
public
getVbUrlScheme() : string
Return values
stringisCreated()
Returns whether the session was created
public
isCreated() : bool
Return values
boolloadLanguage()
Loads basic language information
public
loadLanguage() : mixed
processLogout()
Process any additionl bookkeeping on logout
public
processLogout() : mixed
processNewLogin()
Process any additionl bookkeeping on login
public
processNewLogin() : mixed
save()
Saves the session into the database by inserting it or updating an existing one.
public
save() : mixed
set()
Sets a session variable and updates the change list.
public
set(mixed $key, mixed $value) : mixed
Parameters
- $key : mixed
- $value : mixed
setChannelPerms()
public
setChannelPerms(mixed $key, mixed $perms) : mixed
Parameters
- $key : mixed
- $perms : mixed
setCpsessionHash()
public
setCpsessionHash(mixed $cpsessionhash) : mixed
Parameters
- $cpsessionhash : mixed
validateCpsession()
Validate cpsession
public
validateCpsession([bool $updatetimeout = true ]) : bool
Parameters
- $updatetimeout : bool = true
-
Whether to update the table to reset the timeout