Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 26, 2005 10:41:22

P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Session


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 = 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?
Thank you.
Regards,
L.

Offline

#2 Nov. 26, 2005 17:18:04

David A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Session


On 11/26/05,PythonistL<> wrote: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 doingshopping to cart, that he is login.So, in the login page ( where user insert his ID and password) I  usedrequest.session = UserIDand on  a page, where I would like to inform the user  that is loggedin,I will check the 'UserIsLogged' session.It worked for me   but only until another user logged in. Then ALL sofar 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 issigned with his ID but do not know how. The above outlined proceduredoes 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 athttp://da.textdriven.com:8027/welcome/which shows (or should, modulo bugs) how to do basic registration/login/logout.  The source is available athttp://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

Offline

#3 Nov. 26, 2005 17:55:55

P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Session


Hello David,
Thank you for your reply.
I tried the demo but I think it has the same problem I described.
I registered ( as La ) and was logged in( so far so good).
But when I start another web browser window from and just open your
address again, (http://da.textdriven.com:8027/welcome/) the demo
automatically expects me to be the same user and I am automatically
signed.(instead of being considered as a guest). I do not know how easy
it is to do so with Django and if ever.Any idea?
I look forward to receiving your reply soon
Regards,
Lad.

Offline

#4 Nov. 26, 2005 19:17:59

M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Session


PythonistL wrote:Hello David,
Thank you for your reply.
I tried the demo but I think it has the same problem I described.
I registered ( as La ) and was logged in( so far so good).
But when I start another web browser window from and just open your
address again, (http://da.textdriven.com:8027/welcome/) the demo
automatically expects me to be the same user and I am automatically
signed.Another browser window doesn't represent another user. You identity isstored in cookies and shared among all windows. Or tabs. Or whatever.To become another user you can:
- open another browser (if you have one)- find and remove a cookie from this site manually if your browserallows it (for example in Firefox it is in Options, Privacy, Cookies)- logout on site. Then your browser will deletes (or changesappropriately) the cookie by site's request.

Offline

#5 Nov. 26, 2005 21:18:03

Joey C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Session


On 11/26/05, PythonistL <> wrote:
>
> Hello David,
> Thank you for your reply.
> I tried the demo but I think it has the same problem I described.
> I registered ( as La ) and was logged in( so far so good).
> But when I start another web browser window from and just open your
> address again, (http://da.textdriven.com:8027/welcome/) the demo
> automatically expects me to be the same user and I am automatically
> signed.(instead of being considered as a guest). I do not know how easy
> it is to do so with Django and if ever.Any idea?
> I look forward to receiving your reply soon
>

I agree with Maniac that this sounds like a browser behaviour effect
--- and really, it's an expected behaviour at that.

Try opening two different browsers instead --- say, firefox and
opera --- and try testing it that way.

--joey

Offline

#6 Nov. 27, 2005 02:22:53

Kenneth G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Session


On Saturday 26 Nov 2005 11:25 pm, PythonistL wrote:
> Hello David,
> Thank you for your reply.
> I tried the demo but I think it has the same problem I described.
> I registered ( as La ) and was logged in( so far so good).
> But when I start another web browser window from and just open
> your address again, (http://da.textdriven.com:8027/welcome/)

ahh thats your mistake - all tabs in the webbrowser will use the
same cookie - start a different web browser (firefox for one user
and konq for the other
--
regards
kghttp://www.livejournal.com/users/lawgontally ho!http://avsap.org.inಇಂಡ್ಲಿನಕ್ಸ வாழ்க!

Offline

#7 Nov. 28, 2005 08:37:16

P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Session


Thank you ALL for the explanation. Now I know something more but yet
not sure whether the following procedure will work for different
users.The procedure is like this:
In my web application I would like to tell a user
(when he is doing shopping to a shopping cart), that he is signed with
his ID.
To do so, in the login page ( where the user inserts his ID and
password) I use
request.session = UserID
and on a page, where I would like to inform the user that is logged
in,I will check the 'UserIsLogged' session to find out the signed
user's ID.
But will be the 'UserIsLogged' session different for different users?
Thank you for your help.
Regards,
L.

Offline

Board footer

Moderator control

Enjoy the 20th of January
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support