473,570 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simultaneous sessions ?

Hello again,

I still do not master everything about cookies and session. :o/

After some tests, I understood that when a visitor has several browser
windows open on my website, the same session id is used for all.

The consequence is that if the data are changing in one window, they
will also change in another one.

So before reinventing the wheel, is there a mean for a visitor to have
several sessions opened on my website (one session per window open for
example)?

thanks.

--
Florence HENRY
florence point henry arobasse obspm point fr

Jul 17 '05 #1
16 4415
Is there a mean for the visitor? I really don't know! Do you sometimes
have multiple windows open where you have the site www.google.com loaded
I do that occasionally.

But to return to the browser/session thingy...

If a user uses CTRL+N a new window (assuming Winblows Internet Exploder)
is opened and the session-id in the new window is exactly the same as
the originating window. If they click the shortcut on the desktop or in
the start menu or wherever else they set the shortcut, than that browser
has a new session-id....

Mark

Florence HENRY wrote:
Hello again,

I still do not master everything about cookies and session. :o/

After some tests, I understood that when a visitor has several browser
windows open on my website, the same session id is used for all.

The consequence is that if the data are changing in one window, they
will also change in another one.

So before reinventing the wheel, is there a mean for a visitor to have
several sessions opened on my website (one session per window open for
example)?

thanks.

--
Florence HENRY
florence point henry arobasse obspm point fr

Jul 17 '05 #2
On Wed, 31 Mar 2004 15:57:34 +0200, Mark Kuiphuis
<maluka@remove_ this.koekeloeko e.nl> wrote:
Is there a mean for the visitor? I really don't know! Do you sometimes
have multiple windows open where you have the site www.google.com loaded
I do that occasionally.

But to return to the browser/session thingy...

If a user uses CTRL+N a new window (assuming Winblows Internet Exploder)
is opened and the session-id in the new window is exactly the same as
the originating window. If they click the shortcut on the desktop or in
the start menu or wherever else they set the shortcut, than that browser
has a new session-id....


When I browse, I often open several windows looking at different pages
of the same site. I rely upon them all using the same session id.

I would have expected opening a second instance of the browser would
also behave the same way. The session id is stored in a cookie and
cookies will be shared across browser instances.

The OP could generate his session ids manually and pass them via GET
to persist them in the same browser window. I haven't fully thought
that through, so there's probably a flaw in there somewhere.

--
David ( @priz.co.uk )
Jul 17 '05 #3
Internally sessions are identified by one of two methods; cookies or url
rewriting.

The usual case is using cookies. These cookies are 'soft' cookies which
are kept only in memory. Extra browser windows opened by target=xx in
your HTML or by JavaScript window.open() inherit the parent's
environment including the PHP session id and hence share the same session.

Browser windows opened from elsewhere (start menu, shortcut etc) will
not inherit the environment and will have a different session id.

URL rewriting works much the same way, php parses any <a> tags after
generating your web page and adds the php session id to the query string.
Jul 17 '05 #4
"Mark Kuiphuis" <maluka@remove_ this.koekeloeko e.nl> wrote in message
news:c4******** **@reader11.wxs .nl...
If a user uses CTRL+N a new window (assuming Winblows Internet Exploder)
is opened and the session-id in the new window is exactly the same as
the originating window. If they click the shortcut on the desktop or in
the start menu or wherever else they set the shortcut, than that browser
has a new session-id....


It all depends on whether the browsers belong to the same process. If they
do, then session cookies (ones that vanish when the browser shuts down) are
shared. On systems with more than 32megs of memory, a new process will start
every time you double-click the IE icon. When you open a new window by
hitting Ctrl-N, or through File > Open, or by holding down the ctrl key when
you click on a link, that window will stay with the parent process. On
systems with less than 32megs of ram, all browser windows (as well as the
Windows shell)are of the same process.

Netscape and Opera will run only as one process, so session cookies are
always shared.

As far as I know there is no way you can associate a HTTP request with a
particular window. You might be able to create some kind of locking
mechanism by setting a cookie value in the onload handler, and clearing it
in onunload, but I doubt it would work very well.
Jul 17 '05 #5
Le mercredi 31 Mars 2004 17:16, David Mackenzie a déclaré:
On Wed, 31 Mar 2004 15:57:34 +0200, Mark Kuiphuis
<maluka@remove_ this.koekeloeko e.nl> wrote:
Is there a mean for the visitor? I really don't know! Do you sometimes
have multiple windows open where you have the site www.google.com loaded
I do that occasionally. When I browse, I often open several windows looking at different pages
of the same site. I rely upon them all using the same session id.


The goal of the pages I'm writing is to consult scientific data. So a
visitor may have a browser window for data acquired on day A, and another
one with data acquired on day B. I do not want that when he reloads the
page A, he gets B data ! So there is a mean for the visitor!!!
The OP could generate his session ids manually and pass them via GET
to persist them in the same browser window. I haven't fully thought
that through, so there's probably a flaw in there somewhere.


A solution that I tried was to generate a new id each time the visitor was
visiting the first page of the website, but in that case, a new id is also
generated each time you reload the page, and the /tmp is getting filled
with empty sessions...

--
Florence Henry
florence point henry arobasse obspm point fr
Jul 17 '05 #6
On Thu, 01 Apr 2004 10:37:52 +0200, Florence HENRY
<ra******@duspa m.fr> wrote:
Le mercredi 31 Mars 2004 17:16, David Mackenzie a déclaré:
On Wed, 31 Mar 2004 15:57:34 +0200, Mark Kuiphuis
<maluka@remove_ this.koekeloeko e.nl> wrote:
Is there a mean for the visitor? I really don't know! Do you sometimes
have multiple windows open where you have the site www.google.com loaded
I do that occasionally.

When I browse, I often open several windows looking at different pages
of the same site. I rely upon them all using the same session id.


The goal of the pages I'm writing is to consult scientific data. So a
visitor may have a browser window for data acquired on day A, and another
one with data acquired on day B. I do not want that when he reloads the
page A, he gets B data ! So there is a mean for the visitor!!!


Then can you not pass something on the URL, e.g. data.php?day=A

--
David ( @priz.co.uk )
Jul 17 '05 #7
> The goal of the pages I'm writing is to consult scientific data. So a
visitor may have a browser window for data acquired on day A, and another
one with data acquired on day B. I do not want that when he reloads the
page A, he gets B data ! So there is a mean for the visitor!!!


In that case 'day' is variable between windows and should be passed in
the URL.

Session data is data shared across the whole application.

Of course you could load your actual data into sessions but keyed by a
'day' passed in the URL.
Jul 17 '05 #8
Le jeudi 1 Avril 2004 12:22, Kevin Thorpe a déclaré:
The goal of the pages I'm writing is to consult scientific data. So a
visitor may have a browser window for data acquired on day A, and another
one with data acquired on day B. I do not want that when he reloads the
page A, he gets B data ! So there is a mean for the visitor!!!


In that case 'day' is variable between windows and should be passed in
the URL.


Sure, but there is plenty of information (other than day) that have to be
passed. I wanted to use cookies in order to avoid passing all the
parameters with GET or POST.

--
Florence Henry
florence point henry arobasse obspm point fr
Jul 17 '05 #9
Florence HENRY wrote:
Le jeudi 1 Avril 2004 12:22, Kevin Thorpe a déclaré:

The goal of the pages I'm writing is to consult scientific data. So a
visitor may have a browser window for data acquired on day A, and another
one with data acquired on day B. I do not want that when he reloads the
page A, he gets B data ! So there is a mean for the visitor!!!


In that case 'day' is variable between windows and should be passed in
the URL.

Sure, but there is plenty of information (other than day) that have to be
passed. I wanted to use cookies in order to avoid passing all the
parameters with GET or POST.

In that case, as I suggested create some sort of unique key which will
be passed in GET/POST and store the rest in SESSION under that key.
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
4643
by: Claudio Grondi | last post by:
I would like to save time copying the same file (>6 GByte) to various different target storage media connected to the system via USB. Is there a (Python or other) tool able to help me to do this, so that I don't need to copy the source file first to the first media, then to the second, etc.? Claudio
1
2437
by: slugger | last post by:
Hope this is not OT: I am running into some strange things whenever my ASP pages send out simultaneous requests to another ASP page which in turn gains access to a MySQL database using a DSNless connection string. Whenever I run a page that just puts out a single request things seem to go fine, but if I activate some Flash components that...
6
2316
by: Jimnbigd | last post by:
I want to write a game, and sounds will really add to it. Note that I would always make the sounds optional. I hate it when I go to a URL and unexpectedly get sounds or music. I have played with bgsound in IE, and found I can have simultaneous sounds using multiple bgsound tags. I have done a google search, and the only results I found...
1
3375
by: Semaj | last post by:
Environment: DB2 8.1.4; Windows 2000 We are evaluating the feasibility of upgrading our production DB from 7.2 to 8.1. During this process we've encountered an error when starting our application program, which establishes several JDBC connections to the database. However, this problem can be reproduced in a variety of ways, including...
1
1457
by: pmclinn | last post by:
I have created a aspx page that requires me to pull data from multiple tables in an Oracle DB. The data is pulled down and then stored in local variables, and then closed and disposed. I have implimented an error handling to prevent sessions from remaining open and yet I'm still noticing that sessions to the oracle db are remaining open. ...
12
2299
by: Dan V. | last post by:
Since an ASP.NET/ADO.NET website is run on the server by a single "asp_net worker process", therefore doesn't that mean that even 50 simultaneous human users of the website would appear to the database backend as a single user. Therefore, wouldn't switching our Access (actually Jet 4.0 OLEDB) database backend on our ASP.NET/ADO.NET website to...
2
3824
by: dmagliola | last post by:
Hello all, I'm experiencing a problem with ASP.Net for which I can't find a reasonable explanation, or any information. I'm currently developing an application that, through AJAX, asks the server for updated information to show, and can also send information to the server. To do this, I have an XMLHttpRequest that queries an...
0
937
by: rajaaswin | last post by:
say i open gmail using pamie enter credentials and sign in..... next i create another pamie instance but it directly enters the already entered user account without asking for credentials.... wat shud i do about to get the second instance to ask 4 credentials and login as a differnt user with both sessions active? Please help me out....
4
6458
by: raylopez99 | last post by:
Compound question: first, and this is not easy, if there's a way to detect multiple simultaneous key presses in C# let me know (in the below code, keys c and d being pressed simultaneously or nearly so). I researched this and for C# (as opposed to MFC) there is no library function, and no easy way, though some code on the net suggested that...
0
7724
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7633
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7944
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7699
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6323
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5247
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3681
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.