Connecting Tech Pros Worldwide Forums | Help | Site Map

Session Management

Jay
Guest
 
Posts: n/a
#1: Sep 29 '05
Hello,
Is it possible to have session management differentiate within
browsers on one pc? For example, if you have two browsers on the same
shopping site, and one browser adds to the cart, the other browser
should still show an empty cart. I don't know if this is possible,
since I have done testing on amazon.com, and have seen that when I add
an item to the cart on one browser, then open a 2nd browser window, go
to amazon.com, the cart will contain the item I added from the 1st
browser window. Any ideas?

-Jay
(patel at cs dot utk dot edu)


Gordon Burditt
Guest
 
Posts: n/a
#2: Sep 29 '05

re: Session Management


> Is it possible to have session management differentiate within[color=blue]
>browsers on one pc?[/color]

If you have DIFFERENT BROWSERS on one PC, say, IE and Mozilla,
they won't share cookies. In particular, they won't share the
session cookie. So they'll establish different sessions and
have different session data.
[color=blue]
>For example, if you have two browsers on the same
>shopping site, and one browser adds to the cart, the other browser
>should still show an empty cart.[/color]

I'll disagree about "should" here: that behavior you want might
break a lot of web sites that use frames and sessions, for instance
"webmail" sites, that depend on shared information between frames.

I believe that will happen with DIFFERENT BROWSERS. It won't happen
with two windows from the same running instance of the same browser.
I'm not sure what happens if you try two different running instances
of the same browser (start it up twice - it may not let you do that
using the same user profile for both instances (Firefox won't). It
should, but I haven't tested it, work with two different running
instances of the same browser using different user profiles).
[color=blue]
>I don't know if this is possible,
>since I have done testing on amazon.com, and have seen that when I add
>an item to the cart on one browser, then open a 2nd browser window, go
>to amazon.com, the cart will contain the item I added from the 1st
>browser window. Any ideas?[/color]

Gordon L. Burditt
Colin McKinnon
Guest
 
Posts: n/a
#3: Sep 30 '05

re: Session Management


Jay wrote:
[color=blue]
> Hello,
> Is it possible to have session management differentiate within
> browsers on one pc? For example, if you have two browsers on the same
> shopping site, and one browser adds to the cart, the other browser
> should still show an empty cart. I don't know if this is possible,
> since I have done testing on amazon.com, and have seen that when I add
> an item to the cart on one browser, then open a 2nd browser window, go
> to amazon.com, the cart will contain the item I added from the 1st
> browser window. Any ideas?
>
> -Jay
> (patel at cs dot utk dot edu)[/color]

The short answer is no.

There is (AFAIK) no way way to differentiate between browser windows other
than on the basis of the code they hold. This is ingrained into the
structure of HTTP, HTML and browser technology, although having tried to
solve this problem myself I think it would be a very useful extension.

You could use the use_trans_sid option to get the browser to reference
different sessions but this (IME) doesn't work very reliably.

It is possible to subdivide the session but you still have the problem of
maintaining a reference to the sub-part in the browser window. My form
editor PfP Studio (http://pfp-studio.sourceforge.net) uses this method.

HTH

C.
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#4: Oct 2 '05

re: Session Management


Jay wrote:[color=blue]
> Hello,
> Is it possible to have session management differentiate within
> browsers on one pc? For example, if you have two browsers on the same
> shopping site, and one browser adds to the cart, the other browser
> should still show an empty cart. I don't know if this is possible,
> since I have done testing on amazon.com, and have seen that when I add
> an item to the cart on one browser, then open a 2nd browser window, go
> to amazon.com, the cart will contain the item I added from the 1st
> browser window. Any ideas?[/color]

FWIW, amazon.com and other sites uses DB. So, the history and etc
are not actually stored in session, but stored in DB as user data.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Newbie
 
Join Date: Oct 2005
Posts: 9
#5: Oct 3 '05

re: Session Management


Quote:

Originally Posted by Gordon Burditt

> Is it possible to have session management differentiate within[color=blue]
>browsers on one pc?[/color]

If you have DIFFERENT BROWSERS on one PC, say, IE and Mozilla,
they won't share cookies. In particular, they won't share the
session cookie. So they'll establish different sessions and
have different session data.
[color=blue]
>For example, if you have two browsers on the same
>shopping site, and one browser adds to the cart, the other browser
>should still show an empty cart.[/color]

I'll disagree about "should" here: that behavior you want might
break a lot of web sites that use frames and sessions, for instance
"webmail" sites, that depend on shared information between frames.

I believe that will happen with DIFFERENT BROWSERS. It won't happen
with two windows from the same running instance of the same browser.
I'm not sure what happens if you try two different running instances
of the same browser (start it up twice - it may not let you do that
using the same user profile for both instances (Firefox won't). It
should, but I haven't tested it, work with two different running
instances of the same browser using different user profiles).
[color=blue]
>I don't know if this is possible,
>since I have done testing on amazon.com, and have seen that when I add
>an item to the cart on one browser, then open a 2nd browser window, go
>to amazon.com, the cart will contain the item I added from the 1st
>browser window. Any ideas?[/color]

Gordon L. Burditt

The sessions are managed between the server and the browser. As stated above, if you open another instance of the same browser the session id will be the same. So if you're running Firefox and just open another Firefox browser window the session will still be the same. But if you open a new browser window with IE or Opera or whatever it will generate a new session id. This is, of course, with out you signing into your account on both. Because once you sign in on both browsers the cart will obviously show the item you added to the cart on both browsers.
To answer your question, yes, there is a way to differentiate between sessions. But if you do that then you would have to differentiate between each instance of a browser, using session id, and each instance that a user is logged in. And that is a lot of code that can get very messy quickly.


Good Luck,

~ chipgraphics
Closed Thread