1.2.10.1 The start() Function

The web.auth.start() function has the following parameters:

start( environmentName[, environmentType='database'][, sessionManager=None][, expire=0][, idle=0][, setupSessionEnvironment=0][, setupAuthEnvironment=0][, template][, templateDict = ][, setup = None][, action = ''][, stickyData = ][, redirect=None][, **environmentParams] )

Warning: Because more options may be specified in future versions of this function you should not rely on the order of these parameters. Instead they should be specified with the parameter name and an = sign as is used in the examples in this documentation.

environmentName
The name of the environment

environmentType
The type of environment, currently can only be 'database'.

**environmentParams
Any other parameters needed to correctly specify the environment. For example, if you are using a 'database' environment type you will also need to specify cursor.

sessionManager
A valid web.session manager object. If not specified, one is created using the default options for a CGI environment.

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.

setupSessionEnvironment
Whether to automatically setup a session environment if one is not already present. Warning: If set to True and only some of the required tables are present in the environment, all the session tables will be removed and recreated, losing all the contents. Currently no checking of whether the tables contain the correct fields is done.

setupAuthEnvironment
Whether to automatically setup an auth environment if one is not already present. Warning: If set to True and only some of the required tables are present in the environment, all the auth tables will be removed and recreated, losing all the contents. Currently no checking of whether the tables contain the correct fields is done.

template
An HTML template in which to display the form. Must have %(form)s somewhere in the template.

templateDict
A dictionary of other variables to be embedded into the template

stickyData
A dictionary of key, value pairs to be stored as hidden fields in the sign in form.

redirect
A URL to redirect to after sign in. XXX Currently not working?

redirect
A URL to redirect to after sign in. XXX Currently not working?

action
The action of the form. i.e. the URL of script to send the sign in data to.

setup
A function definition taking a AuthManager object as its only parameter which can be used to setup auth data if the auth environment is created.