This is a limitation of the browser.  It does not keep separate credentials
for separate windows.  This is usually desirable because you may choose
to open a link in a new window (or tab) and you still expect to be logged in.

The only solution I know is to run separate browsers.  You can install, say,
both firefox and chrome, for example.  If you truly need to have them be the
same browser version, then the easiest thing is to run one in a virtual
machine.

On linux you can, if you are sharp, run two X servers on two separate
virtual terminals, and log in as different users on the two of them.  Browsers
run by separate users are separate.  On windows you might do this with
the switch user without logging out functionality.  I don't know about Macs.

Bill

On Tue, Oct 19, 2010 at 10:55 AM, PyMan <claudio.marino...@rsoft.it> wrote:
> Hi guys,
> I need some help about logins and session and any help would be much
> appreciated :)
>
> This is the scenario:
> * Django 1.2.0
> * Firefox (but I think any browser too)
>
> This the steps:
> 1) In the same computer (so in the same browser session) I have two
> browser windows "W1" and "W2" where the user "U1" is already logged in
> in both windows.
> 2) In the browser window "W1" the user logs out
> 3) In the browser window "W1" the user "U2" logins in and gets
> redirect to the main web page
> 4) In the browser window "W2" any call to the views (all using the
> "login_required" decorator) is done with request.user set to "U2"
> instead the old "U1" --> here the human user could still think to be
> "U1" in this window (indeed he can see "U1" printed in the web page
> previously rendered), but he's surfing like "U2"
>
> Since you can't keep to more logged users in the same session, I'd
> like to catch this situation and redirect the user to the log in page.
>
> Of course I don't want to rewrite all the ajax and not ajax calls to
> pass the "current" (means "old") user as parameter to match with
> request.user for a change. It's ugly and expensive.
>
> Any idea?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to