473,503 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Different sessions in different windows?

Hi all,

The title says it all - I'm doing sessions with cookies. I can divide the
data within the session easily enough but I can't see when the user creates
a new window or closes an old one.

TIA,

C.
Jul 17 '05 #1
3 2196
What happens on the client web browser is not necessarily communicated to
the web server. You cannot tell when the user creates or closes a browser
window as nothing is sent to the server. The only time that the server knows
what happened is when it receives an HTTP request (using either the GET or
POST methods).

--
Tony Marston

http://www.tonymarston.net

"Colin McKinnon" <co**************@andthis.mms3.com> wrote in message
news:ck*******************@news.demon.co.uk...
Hi all,

The title says it all - I'm doing sessions with cookies. I can divide the
data within the session easily enough but I can't see when the user
creates
a new window or closes an old one.

TIA,

C.

Jul 17 '05 #2
Colin McKinnon wrote:
Hi all,

The title says it all - I'm doing sessions with cookies. I can divide
the data within the session easily enough but I can't see when the
user creates a new window or closes an old one.


This is something out of your control. PHP being serverside you just
have to accept the fact that clients with their array of browsers and
software will be requesting your pages from the server handling them
clientside in which ever way they prefer. Some browsers can instantiate
new windows, others might do it in another manner. Your server or the
script has no way of controlling that or even knowing if it is happening
or not.

Through javascript you could make some complicated scripts that interact
with PHP when the client opens new windows or does some wacky stuff, but
this just _might_ work in the mainstram browsers after a lot of work and
experimenting, and even then just turning off javascript would destroy
it. Relying on javascript or any other hacks like this should be
strongly discouraged.

Programming for the web has its limitations, or rather, requires a
different way of thinking than the common clientside programming.

It would help if you told in more detail what it is that you are really
trying to do. If you wish to have the same client operating the
script(s) with many browsers/windows/accounts at the same time, you
might need to start carrying some kind of unique id's with all pages
manually instead of sessions (since they get shared with different
windows of the same browser). This might not be as big of a deal as you
might think (output buffering, includes and perhaps a class doing the
stuff automatically might be something to take a closer look at).

--
Suni

Jul 17 '05 #3
Colin McKinnon <co**************@andthis.mms3.com> wrote in message news:<ck*******************@news.demon.co.uk>...
Hi all,

The title says it all - I'm doing sessions with cookies. I can divide the
data within the session easily enough but I can't see when the user creates
a new window or closes an old one.


Opening new window by pressing Ctrl+N shouldn't generate a new
session on any circumstances. For the other case, i.e., closing the
browser and restarting, you may try persistent session cookies (cookie
with life time>0).

session.cookie_lifetime <http://in.php.net/session>

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #4

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

Similar topics

2
3542
by: Simon | last post by:
Hi Folks, Any help here would be much appreciated. i have a page session_write.php /////////////////// session_start(); $_SESSION = 'AAA'; print("sA". $_SESSION);
3
2454
by: Maxime Ducharme | last post by:
Hi group We have a problem with sessions in one of our sites. Sessions are used to store login info & some other infos (no objects are stored in sessions). We are using Windows 2000 Server...
0
1818
by: Nonoy of Philippines | last post by:
Hello, guys... I'm just starting to develop web applications and I have this problem regarding Session objects At some parts of my application, I open modal dialog window which also opens...
6
3764
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
1
3437
by: David Gaudine | last post by:
(This is a bit like the recent thread "PHP Switching Sessions".) I use session_start(). When I open my web-based application in two windows on the same system, there's a definite clash; I can't...
1
5201
by: Duncan | last post by:
I have a strange problem with sessions in PHP 5. I have a simple script that prints a random number both as a string and a picture on the screen. When I run the script for the first time, it works...
3
1669
by: AlonR | last post by:
Hi, We're experiencing random user sessions losses on our web applications, and are researching for any useful information which may shed light on this problem. Environment: In our...
43
3381
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
0
1135
by: kevin bailey | last post by:
Must be missing something obvious here but if I create sessions on a server I use $b = new Auth("MDB2"); $b->setSessionname("SESSION1"); This means I can have other sessions created by ...
0
7201
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,...
0
7083
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...
1
6988
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...
0
5578
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 projectplanning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
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...
0
3166
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...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.