Hi,
Is it possible to do the following with the sessions?
In my web application I would like to tell a user ,when he is doing
shopping to cart, that he is login.
So, in the login page ( where user insert his ID and password) I used
request.session['UserIsLogged'] = UserID
and on a page, where I would like to inform the user that is logged
in,I will check the 'UserIsLogged' session.
It worked for me but only until another user logged in. Then ALL so
far signed users were regarded as the last signed user because
'UserIsLogged' session was overwritten by the last signed UserID.
To sum up, I would like to inform ( in various views) that a user is
signed with his ID but do not know how. The above outlined procedure
does not work :-(
So, how to solve that above outlined problem?
You want to read up on user authentication: http://www.djangoproject.com/documentation/authentication/
I have a demo app at http://da.textdriven.com:8027/welcome/ which shows (or should, modulo bugs) how to do basic registration/login/logout. The source is available at http://da.textdriven.com:9021/sydney/browser/trunk/dacontrib/apps/registration/. Mostly it's one new function to do online registration, and broken out templates that don't refer to the admin templates.
The users created by the site are not marked as _staff_, so they don't have access to the admin site (or shouldn't -- I haven't tested that).
Hope that helps,
--david