API documentation :: Docs For Class arbitSession
Packages:Interfaces:
Classes:
|
Core::arbitSessionClass arbitSessionArbit session wrapper We use a wrapper around PHPs well working and abstracted sessions functions, because we want to additionally offer the following:
Arbit session wrapper We use a wrapper around PHPs well working and abstracted sessions functions, because we want to additionally offer the following:
Member Variables
Method Summary
MethodscheckClientHash
static void
checkClientHash(
)
Ensure client hash stays the same This method will throw an exception, if it notices a session takeover. Ensure client hash stays the same This method will throw an exception, if it notices a session takeover. The check for this bases only on the user-agent string, and may be considered too weak. checkToken
static bool
checkToken(
string
$token
)
Check one-time token Check if the given one-time token is valid and return the validation state. be reused, and even a second call to this function will not return true any more. Check one-time token Check if the given one-time token is valid and return the validation state. Valid tokens will be removed from the list, so that they may not be reused, and even a second call to this function will not return true any more. Parameters:
close
static void
close(
)
Close current session Close current session for writing, so that other request are not locked. Close current session Close current session for writing, so that other request are not locked. generateFormToken
static void
generateFormToken(
)
Generate new one time token Generate a new one-time token, which can be used by all forms diuring the current request. stored in the session. Generate new one time token Generate a new one-time token, which can be used by all forms diuring the current request. Ensures that not too many one-time tokens are stored in the session. This might break submitting forms which are kept open in browser, while surfing the website in another widow / tab. get
static mixed
get(
string
$key
)
Get session value. Get session value. Parameters:
getCurrentRequest
static arbitRequest
getCurrentRequest(
)
Get currently selected request Currently executed request, available for application wide read access of the current request context. Get currently selected request Currently executed request, available for application wide read access of the current request context. getFormToken
static string
getFormToken(
)
Get one-time form token Generate a one-time token for input forms, so that they cannot be resubmitted. can only be used one time to validate form contents against it. Get one-time form token Generate a one-time token for input forms, so that they cannot be resubmitted. The returned "random" token is stored in the session and can only be used one time to validate form contents against it. getGlobal
static mixed
getGlobal(
string
$key
)
Get global session key value Get the value of a global session key. independant, and should commonly not be used. Get global session key value Get the value of a global session key. These session keys are project independant, and should commonly not be used. Parameters:
initialize
static void
initialize(
arbitRequest
$request
)
Initialize session from currently selected project This method may throw a arbitSessionTakeOverException, if a session takeover is detected. Initialize session from currently selected project This method may throw a arbitSessionTakeOverException, if a session takeover is detected. Parameters:
login
static bool
login(
arbitModelUser
$user
)
Login a user in the current project Login a user in the current project Parameters:
logout
static void
logout(
)
Logout a user in the current project Logout a user in the current project may
static bool
may(
string
$permission
)
Checks if user has proper rights for some action Checks if the current user has the permissions for the requested priviledge. Checks if user has proper rights for some action Checks if the current user has the permissions for the requested priviledge. Parameters:
regenerateId
static void
regenerateId(
)
Method to regenerate session ID Performs additional checks, to work in the test environment and may check for strange circumstances. Method to regenerate session ID Performs additional checks, to work in the test environment and may check for strange circumstances. remove
static void
remove(
string
$key
)
Remove a session variable Remove a value completey from the session. Remove a session variable Remove a value completey from the session. Parameters:
resetSession
static void
resetSession(
)
Reset the session Reset the current session, by assigning only the permissions for anonymous users and resetting the login state. Reset the session Reset the current session, by assigning only the permissions for anonymous users and resetting the login state. set
static mixed
set(
string
$key
, mixed
$value
)
Set session value. Set session value. Set the session value and return the set value to enable fluent interfaces. The method may implement value checks for some values in the future. Parameters:
setBackend
static void
setBackend(
arbitSessionBackend
$backend
)
Set session backend Configure the session backend to use. Set session backend Configure the session backend to use. Parameters:
setGlobal
static mixed
setGlobal(
string
$key
, mixed
$value
)
Ret global session key value Set the value of a global session key. independant, and should commonly not be used. Ret global session key value Set the value of a global session key. These session keys are project independant, and should commonly not be used. Returns the set value. Parameters:
Documentation generated on Mon, 05 Apr 2010 14:02:17 +0200 by phpDocumentor 1.4.3
|