### 1.2.10.3 AuthSession Objects

The `web.auth.session()` function has the following parameters and is used to create a `AuthSession` onject:

`sesssion`( | store, [expire=0], [idle=0])

  store
    A valid `web.session` `Store` object.

  expire
    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.

  idle
    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.

The `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:

  `username`( | )

    Returns the username as a string if a user is signed in, otherwise returns an empty string `''`.

  `signIn`( | username)

    Sign in the user with username username.

  `signOut`( | )

    Sign out the signed in user.

  `userInfo`( | )

    If a user is signed in, returns a dictionary with the following keys: `'username'`, `'started'`, `'accessed'`, `'expire'`, `'idle'`. If no user is signed in returns `None`.