Discussion:
multiple sessions for the same user
Larry Martell
2014-04-03 20:43:00 UTC
Permalink
I have a php app that uses a session to share data across requests
(using session_start())

I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jonathan Sundquist
2014-04-03 20:45:06 UTC
Permalink
Use either two completely different browsers or if they need to use the
same browser open one of the sessions in privacy mode.
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Larry Martell
2014-04-03 20:48:46 UTC
Permalink
Use either two completely different browsers or if they need to use the same
browser open one of the sessions in privacy mode.
Thanks for the reply, but they don't want to use different browsers,
and they may want to open more then just 2 tabs.
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Aziz Saleh
2014-04-03 20:48:59 UTC
Permalink
Post by Jonathan Sundquist
Use either two completely different browsers or if they need to use the
same browser open one of the sessions in privacy mode.
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I never use sessions except to identify the identity of the user.
Everything else is handled by the app. I guess that is just me.

Maybe try adding a GET identifier (or post, etc..) to the request so you
can distinguish between the data and store the data in the session in an
array instead?
Ashley Sheridan
2014-04-03 20:54:02 UTC
Permalink
Ask the user if they have seen this behavior elsewhere to establish a base. It really doesn't seem reasonable, but could be achieved with a token based request system. Thing is, it would not remember users between visits.
On Thu, Apr 3, 2014 at 4:45 PM, Jonathan Sundquist
Post by Jonathan Sundquist
Use either two completely different browsers or if they need to use
the
Post by Jonathan Sundquist
same browser open one of the sessions in privacy mode.
On Thu, Apr 3, 2014 at 3:43 PM, Larry Martell
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the
app
Post by Jonathan Sundquist
Post by Larry Martell
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I never use sessions except to identify the identity of the user.
Everything else is handled by the app. I guess that is just me.
Maybe try adding a GET identifier (or post, etc..) to the request so you
can distinguish between the data and store the data in the session in an
array instead?
Thanks,
Ash
Larry Martell
2014-04-03 21:00:25 UTC
Permalink
On Thu, Apr 3, 2014 at 4:54 PM, Ashley Sheridan
Post by Ashley Sheridan
Ask the user if they have seen this behavior elsewhere to establish a base.
It really doesn't seem reasonable, but could be achieved with a token based
request system. Thing is, it would not remember users between visits.
Yeah, first thing I said was, well you can't be logged into 2 gmail or
amazon accounts in 2 tabs of the same browser either.
Post by Ashley Sheridan
On Thu, Apr 3, 2014 at 4:45 PM, Jonathan Sundquist
Post by Jonathan Sundquist
Use either two completely different browsers or if they need to use the
same browser open one of the sessions in privacy mode.
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I never use sessions except to identify the identity of the user.
Everything else is handled by the app. I guess that is just me.
Maybe try adding a GET identifier (or post, etc..) to the request so you
can distinguish between the data and store the data in the session in an
array instead?
Thanks,
Ash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stuart Dallas
2014-04-03 21:08:55 UTC
Permalink
Post by Larry Martell
On Thu, Apr 3, 2014 at 4:54 PM, Ashley Sheridan
Post by Ashley Sheridan
Ask the user if they have seen this behavior elsewhere to establish a base.
It really doesn't seem reasonable, but could be achieved with a token based
request system. Thing is, it would not remember users between visits.
Yeah, first thing I said was, well you can't be logged into 2 gmail or
amazon accounts in 2 tabs of the same browser either.
But you can look at two different folders in Gmail or two different products on Amazon, which is what the OP sounds like they’re wanting to do.

If they actually want to log in to two different "accounts" at once, create a meta account that gives them access to both sets of data. It sounds like the access requirements for your app are changing, so change the design of your app to cope.


-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
Post by Larry Martell
Post by Ashley Sheridan
On Thu, Apr 3, 2014 at 4:45 PM, Jonathan Sundquist
Post by Jonathan Sundquist
Use either two completely different browsers or if they need to use the
same browser open one of the sessions in privacy mode.
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I never use sessions except to identify the identity of the user.
Everything else is handled by the app. I guess that is just me.
Maybe try adding a GET identifier (or post, etc..) to the request so you
can distinguish between the data and store the data in the session in an
array instead?
Thanks,
Ash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ricardo R Bonfim
2014-04-03 21:13:29 UTC
Permalink
Have you searched about browser tab pid? maybe you could consider that
on your authentication process...

You could also read something about browser private session and its
consequences on php session... Not sure if could help actually...
Post by Larry Martell
On Thu, Apr 3, 2014 at 4:54 PM, Ashley Sheridan
Post by Ashley Sheridan
Ask the user if they have seen this behavior elsewhere to establish a base.
It really doesn't seem reasonable, but could be achieved with a token based
request system. Thing is, it would not remember users between visits.
Yeah, first thing I said was, well you can't be logged into 2 gmail or
amazon accounts in 2 tabs of the same browser either.
But you can look at two different folders in Gmail or two different products on Amazon, which is what the OP sounds like they're wanting to do.
If they actually want to log in to two different "accounts" at once, create a meta account that gives them access to both sets of data. It sounds like the access requirements for your app are changing, so change the design of your app to cope.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
Post by Larry Martell
Post by Ashley Sheridan
On Thu, Apr 3, 2014 at 4:45 PM, Jonathan Sundquist
Post by Jonathan Sundquist
Use either two completely different browsers or if they need to use the
same browser open one of the sessions in privacy mode.
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I never use sessions except to identify the identity of the user.
Everything else is handled by the app. I guess that is just me.
Maybe try adding a GET identifier (or post, etc..) to the request so you
can distinguish between the data and store the data in the session in an
array instead?
Thanks,
Ash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
____________________________________________________
Ricardo R Bonfim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Larry Martell
2014-04-03 21:14:37 UTC
Permalink
Post by Stuart Dallas
Post by Larry Martell
On Thu, Apr 3, 2014 at 4:54 PM, Ashley Sheridan
Post by Ashley Sheridan
Ask the user if they have seen this behavior elsewhere to establish a base.
It really doesn't seem reasonable, but could be achieved with a token based
request system. Thing is, it would not remember users between visits.
Yeah, first thing I said was, well you can't be logged into 2 gmail or
amazon accounts in 2 tabs of the same browser either.
But you can look at two different folders in Gmail or two different products on Amazon, which is what the OP sounds like they’re wanting to do.
If they actually want to log in to two different "accounts" at once, create a meta account that gives them access to both sets of data. It sounds like the access requirements for your app are changing, so change the design of your app to cope.
The first page of the app allows then to select what dataset they want
to look at (development, QA, production, hot back up, or yesterday's
data). Then on the next page they select more specifics about the data
they want to see. So what happens is that if they select QA and "foo"
on one tab and production and "bar" on another, they get the same on
both (the later one they brought up). Yes, it seems that it will
require a design change - I was hoping to avoid that if possible and
do something with the sessions.
Post by Stuart Dallas
Post by Larry Martell
Post by Ashley Sheridan
On Thu, Apr 3, 2014 at 4:45 PM, Jonathan Sundquist
Post by Jonathan Sundquist
Use either two completely different browsers or if they need to use the
same browser open one of the sessions in privacy mode.
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I never use sessions except to identify the identity of the user.
Everything else is handled by the app. I guess that is just me.
Maybe try adding a GET identifier (or post, etc..) to the request so you
can distinguish between the data and store the data in the session in an
array instead?
Thanks,
Ash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stuart Dallas
2014-04-03 23:35:14 UTC
Permalink
I do apologise for the top post but this needs to be said now rather than wait until I'm back in front of a decent email client.


Those different versions of the site/app/data/whatever the hell you want to call them should not be able to access each other's data. They should be separate sites on separate domain names and ideally on separate servers. This is not a design change that has been triggered by changing requirements, this is a bad design decision that should never have been allowed to happen.




The mind boggles as to how you test new development in an isolated and repeatable way. My guess is that you don't!




-Stuart
—
Sent from my leaf blower
Post by Larry Martell
Post by Larry Martell
On Thu, Apr 3, 2014 at 4:54 PM, Ashley Sheridan
Post by Ashley Sheridan
Ask the user if they have seen this behavior elsewhere to establish a base.
It really doesn't seem reasonable, but could be achieved with a token based
request system. Thing is, it would not remember users between visits.
Yeah, first thing I said was, well you can't be logged into 2 gmail or
amazon accounts in 2 tabs of the same browser either.
But you can look at two different folders in Gmail or two different products on Amazon, which is what the OP sounds like they’re wanting to do.
If they actually want to log in to two different "accounts" at once, create a meta account that gives them access to both sets of data. It sounds like the access requirements for your app are changing, so change the design of your app to cope.
The first page of the app allows then to select what dataset they want
to look at (development, QA, production, hot back up, or yesterday's
data). Then on the next page they select more specifics about the data
they want to see. So what happens is that if they select QA and "foo"
on one tab and production and "bar" on another, they get the same on
both (the later one they brought up). Yes, it seems that it will
require a design change - I was hoping to avoid that if possible and
do something with the sessions.
Post by Larry Martell
Post by Ashley Sheridan
On Thu, Apr 3, 2014 at 4:45 PM, Jonathan Sundquist
Post by Jonathan Sundquist
Use either two completely different browsers or if they need to use the
same browser open one of the sessions in privacy mode.
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I never use sessions except to identify the identity of the user.
Everything else is handled by the app. I guess that is just me.
Maybe try adding a GET identifier (or post, etc..) to the request so you
can distinguish between the data and store the data in the session in an
array instead?
Thanks,
Ash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
m***@behnke.biz
2014-04-04 10:04:50 UTC
Permalink
Don't use cookie based session but put the session ID into the url
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ***@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Larry Martell
2014-04-04 12:01:43 UTC
Permalink
Post by m***@behnke.biz
Don't use cookie based session but put the session ID into the url
Would that give me a separate session per tab?

I've been reading this page: http://www.php.net/manual/en/session.idpassing.php

If I enable use_trans_sid will this automagically start using session IDs?
Post by m***@behnke.biz
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tony Marston
2014-04-04 14:54:06 UTC
Permalink
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
Yes, this is possible because I have implemented this feature in my
framework. It allows any user to have any number of independent sessions in
any browser. My solution is documented in
www dot tonymarston.net/php-mysql/client-clones.html
--
Tony Marston
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Larry Martell
2014-04-04 15:41:27 UTC
Permalink
Post by Tony Marston
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
Yes, this is possible because I have implemented this feature in my
framework. It allows any user to have any number of independent sessions in
any browser. My solution is documented in
www dot tonymarston.net/php-mysql/client-clones.html
Thank you very much Tony. I am going to look into implementing this
now. One question - does use_trans_sid have to be set for this to
work? I asked because I am getting some push back from my admins about
setting that.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jim Lucas
2014-04-04 15:52:35 UTC
Permalink
Post by Larry Martell
Post by Tony Marston
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
Yes, this is possible because I have implemented this feature in my
framework. It allows any user to have any number of independent sessions in
any browser. My solution is documented in
www dot tonymarston.net/php-mysql/client-clones.html
Thank you very much Tony. I am going to look into implementing this
now. One question - does use_trans_sid have to be set for this to
work? I asked because I am getting some push back from my admins about
setting that.
You can set this manually within your scripts.

http://www.php.net/manual/en/session.configuration.php#ini.session.use-trans-sid
--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tony Marston
2014-04-04 16:02:08 UTC
Permalink
Post by Larry Martell
Post by Tony Marston
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
Yes, this is possible because I have implemented this feature in my
framework. It allows any user to have any number of independent sessions in
any browser. My solution is documented in
www dot tonymarston.net/php-mysql/client-clones.html
Thank you very much Tony. I am going to look into implementing this
now. One question - does use_trans_sid have to be set for this to
work? I asked because I am getting some push back from my admins about
setting that.
Post by Tony Marston
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
Yes, this is possible because I have implemented this feature in my
framework. It allows any user to have any number of independent sessions in
any browser. My solution is documented in
www dot tonymarston.net/php-mysql/client-clones.html
Thank you very much Tony. I am going to look into implementing this
now. One question - does use_trans_sid have to be set for this to
work? I asked because I am getting some push back from my admins about
setting that.
This procedure uses session cookies only, so I use the following settings in
my htaccess file:

php_value session.use_cookies 1
php_value session.use_only_cookies 1
php_value session.use_trans_sid 0
--
Tony Marston
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Larry Martell
2014-04-04 19:22:37 UTC
Permalink
Post by Tony Marston
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
Yes, this is possible because I have implemented this feature in my
framework. It allows any user to have any number of independent sessions in
any browser. My solution is documented in
www dot tonymarston.net/php-mysql/client-clones.html
I'm trying to implement your solution, and what is happening is that
each frame in each page is getting it's own session (instead of a new
session only getting created when I click on the "new session" link).

I'm not sure what to use in place of 'whatever' in your example:

<input type="hidden" name="session_name" value="whatever" />

Right now I am passing in 'whatever' so perhaps that is my issue.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Larry Martell
2014-04-04 20:57:35 UTC
Permalink
On Fri, Apr 4, 2014 at 3:22 PM, Larry Martell
Post by Larry Martell
Post by Tony Marston
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
Yes, this is possible because I have implemented this feature in my
framework. It allows any user to have any number of independent sessions in
any browser. My solution is documented in
www dot tonymarston.net/php-mysql/client-clones.html
I'm trying to implement your solution, and what is happening is that
each frame in each page is getting it's own session (instead of a new
session only getting created when I click on the "new session" link).
<input type="hidden" name="session_name" value="whatever" />
Right now I am passing in 'whatever' so perhaps that is my issue.
I got this working. I figured out I have to pass in the session_name
in place of "whatever"

Thanks very much Tony for putting up that web page and pointing me at it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Larry Martell
2014-04-08 15:29:00 UTC
Permalink
Post by Tony Marston
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
Yes, this is possible because I have implemented this feature in my
framework. It allows any user to have any number of independent sessions in
any browser. My solution is documented in
www dot tonymarston.net/php-mysql/client-clones.html
Tony- wanted to let you know that after I implemented this I found I
didn't even need the "new session" link:

<a href="HTTP://whatever/script.php?action=newsession&session_name=menu0">new
session</a>

Because the code expects to get the session name from the URL, since
the main page doesn't supply that, I automagically get a new session
every time I bring up a new instance from the main page.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tony Marston
2014-04-08 15:46:18 UTC
Permalink
Post by Larry Martell
Post by Tony Marston
Post by Larry Martell
I have a php app that uses a session to share data across requests
(using session_start())
I have a situation where a user wants to open 2 invocations of the app
in 2 browser tabs and look at different things, but because of the
session, both tabs have the same data. Is there a way to have a
separate session for each tab they open?
Yes, this is possible because I have implemented this feature in my
framework. It allows any user to have any number of independent sessions in
any browser. My solution is documented in
www dot tonymarston.net/php-mysql/client-clones.html
Tony- wanted to let you know that after I implemented this I found I
<a
href="HTTP://whatever/script.php?action=newsession&session_name=menu0">new
session</a>
Because the code expects to get the session name from the URL, since
the main page doesn't supply that, I automagically get a new session
every time I bring up a new instance from the main page.
I only use the 'new session' link if I have cloned the current web page into
another browser window as the cloned window starts off with the same
settings as the original window, and therefore the same session. By pressing
the 'new session' link in either one of the two browser windows I force that
window to use a separate session.
--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...