Users_Session Class
Class representing 'Session' rows in the 'Users' database You can create an object of this class either to access its non-static methods, or to actually represent a session row in the Users database.
Methods
__set_state
-
$array
Implements the __set_state method, so it can work with with var_export and be re-imported successfully.
Parameters:
-
$array
Array
Returns:
Class instance
copyToNewSesion
-
$sessionFields
-
[$duration='year']
Saves a new Users_Session row with a copy of all the content from the current session. Does not change the current session id.
Parameters:
-
$sessionFields
ArrayPass an array with keys such as "platform", "appId", "version", "deviceId", "formFactor"
-
[$duration='year']
String | Integer optionalThe key in the Q/session/durations config field or number of seconds. Pass 0 to expire at the end of browser session.
Returns:
the id of the newly saved Users_Session row
setUp
()
The setUp() method is called the first time an object of this class is constructed.
Events
Users/Session/copyToNewSession
After
This is a hook for after the session has been copied to a new session. You may want to do extra security checks here. You may also want to notify the user that there has been a new session started from a new platform + appId.
Event Payload:
-
$from
Users_SessionThe session that was copied from
-
$to
Users_SessionThe session that was copied to