The web.auth.session() function has the following parameters and is used to create a
||store, [expire=0], [idle=0])|
- A valid web.session
- An integer specifying the number of seconds before the user is signed out. A value of 0 disables the expire functionality and the user will be signed in until they sign out. Note:
If the underlying session expires, the cookie is removed or the sign in idles before the expire time specified in expire the user will be signed out.
- An integer specifying the maximum number of seconds between requests before the user is automatically signed out. A value of 0 disables the idle functionality allowing an unlimited amount of time between user requests. Note:
If the underlying session expires, the cookie is removed or the sign in expires before the idle time specified in idle the user will be signed out.
AuthSession object returned by the session() function has the following methods and attributes:
- class AuthSession
For managing the auth information stored in the session store. Has the following methods:
Returns the username as a string if a user is signed in, otherwise returns an empty string
Sign in the user with username username.
Sign out the signed in user.
If a user is signed in, returns a dictionary with the following keys:
'idle'. If no user is signed in returns