SESSION_NAME
SESSION_NAME
A class to handle the current session. This class holds the name of the session and the user ID associated with it.
The class is used to sign in and sign out clients from the system
Be sure to have a session_start() at the beginning AND before this class's instanciation.
challengeSession( $defaultSignInPage = \MySessionHandler::DEFAULT_SIGNIN_PAGE)
Checks if the current session is registered (via isSignedIn()).
If not, changes the header to the default sign-in page.
$defaultSignInPage | A page to redirect to if the session challenge fails. |
signIn( $challengePassword, $userObj)
Sign a user in, if the session does not already exist.
A challenge password must be provided along with the user's id and password from the system to compare with. If success, session is created.
Before calling this function, use the username to determine which user is trying to sign-in. Once found, call this function to now verify the password, and subsequently set the session.
$challengePassword | A password typed in by the user (a regular word string, not encrypted) |
|
$userObj |