Previous topic

stalker.ext.auth.create_session

Next topic

stalker.ext.auth.login_required

This Page

stalker.ext.auth.login

static auth.login(user=None)

Persists the user_id in a session.

The idea behind login is to store the user in a session and retrieve it back without asking the credentials over and over again by getting the user from the session it self.

The user id is saved in the session.

This should not mixed with the authentication where the user is authenticated against the given username and password. This functions purpose is to store the user in a session.

Parameters:user (stalker.core.models.User) – The user object which wanted to be logged in. Can be given as None then the user id in the session will be used. And if there are no session and thus the user id in the session is None than a loggin error will be raised. So by this way the user is logged in only one time.