473,657 Members | 2,716 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 2205
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******** ***********@new s.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******* ************@ne ws.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
3559
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
2463
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 (IIS 5.0) with ASP 3.0 (no .NET on this site). Sometime, data in session is emptied. I say "sometime"
0
1835
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 another window to display a report. To do this, I use the values of Sessions I initialize at the windows that called the modal dialog box. However, I noticed that the values of my Sessions were gone when I opened the modal dialog window ONLY when...
6
3784
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 one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
1
3446
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 do two independent sessions because the session variables are shared. I solved that the easy way, by not opening two windows. But then I went on to write more applications, and found that if I use the same variable names (for session variables)...
1
5208
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 perfectly. However, when I refresh the page, new updated random number does not propagate to the image displayer script through sessions. The image displayer script continues showing the old number instead of the new random number. I checked the...
3
1676
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 company, we're developing a web product based on ASP.NET 2.0, in conjunction with Oracle database over ADO.NET and external COM objects
43
3412
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
1143
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 $b = new Auth("MDB2");
0
8303
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8723
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8502
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7316
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, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1601
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.