473,652 Members | 3,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sessions not available to different browser window.

Hi Folks,

Any help here would be much appreciated.
i have a page session_write.p hp
///////////////////
session_start() ;
$_SESSION['A'] = 'AAA';
print("sA". $_SESSION['A']);
//////////////////////
and session_read.ph p
//////////////////
session_start() ;
if (isset ($_SESSION['A']))
{
print ('sessions set');
}
else{
print ('sessions not set');
}

print($_SESSION['A']);
//////////////////////

if i call session_write.p hp and then session_read.ph p in the same browser
window all is fine. but if i call session_read.ph p from a different browswer
window, it doesn't see the session variable A.

I'm using php 4 on linux and internet explorer 6 on windows 2000.

What could be happening here?

thanks,

simon.

Jul 17 '05 #1
2 3557
When you open up another browser window you are effectively creating a new
session.

Tony Marston

"Simon" <si***@nospam i-muse.nu> wrote in message
news:RD******** **************@ news.xtra.co.nz ...
Hi Folks,

Any help here would be much appreciated.
i have a page session_write.p hp
///////////////////
session_start() ;
$_SESSION['A'] = 'AAA';
print("sA". $_SESSION['A']);
//////////////////////
and session_read.ph p
//////////////////
session_start() ;
if (isset ($_SESSION['A']))
{
print ('sessions set');
}
else{
print ('sessions not set');
}

print($_SESSION['A']);
//////////////////////

if i call session_write.p hp and then session_read.ph p in the same browser
window all is fine. but if i call session_read.ph p from a different browswer window, it doesn't see the session variable A.

I'm using php 4 on linux and internet explorer 6 on windows 2000.

What could be happening here?

thanks,

simon.

Jul 17 '05 #2
Simon wrote:
Hi Folks,

Any help here would be much appreciated.
i have a page session_write.p hp
///////////////////
session_start() ;
$_SESSION['A'] = 'AAA';
print("sA". $_SESSION['A']);
//////////////////////
and session_read.ph p
//////////////////
session_start() ;
if (isset ($_SESSION['A']))
{
print ('sessions set');
}
else{
print ('sessions not set');
}

print($_SESSION['A']);
//////////////////////

if i call session_write.p hp and then session_read.ph p in the same browser
window all is fine. but if i call session_read.ph p from a different browswer
window, it doesn't see the session variable A.

I'm using php 4 on linux and internet explorer 6 on windows 2000.

What could be happening here?

thanks,

simon.


As someone else has said each browser window is a separate session. If
you want to link the two then you can always pass the session id in the
GET or POST

Jul 17 '05 #3

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

Similar topics

13
12035
by: jing_li | last post by:
Hi, you all, I am a newbee for php and I need your help. One of my coworker and I are both developing a webpage for our project using php. We have a copy of the same files in different location on the server (in our own accounts on the same machine). When I am testing both versions of our program using the same browser (IE on Windows or Konqueror on Linux) the session variables will mix up and only the latest selection or options will...
4
3106
by: Steve | last post by:
Hi, I need to be able to open another browser from within an already opened browser with a completely new session (using the same session variables). How can I do this? In essence, I want to allow a (super) user to be logged in as another user but without closing his/her own original session. I've tried everything but the new browser overwrites the old session variables. I even tried 'regenerating' a new session ID but the new ID...
4
31184
by: john | last post by:
How do u guys handle multiple sessions?? i.e, opening different browser windows by running iexplore.exe or clicking IE icons and opening the application. My sessions are mixing up. what i mean is suppose i log in my site using username "test". At this time I set $_SESSION="test". And I use $_SESSION inside my application to print the username. Now if I open another browser & log in with "another test" the session
22
2872
by: Theo | last post by:
Question for the group The authentication system for the site Im working on seems to function properly and all is good. A session keeps track of everything and a cookie is used to accept or deny access... sounds as it should be I hope. Then when all is done logging out destroys everything and the pages are no longer accessable. Good so far. But two things come to mind: one is preventing multiple logins of the user/password. The...
17
8017
by: Peter Chant | last post by:
Am I right in assuming that when I connect from one browser, using several tabs to a database produced in mysql/php/apache only uses one session for all tabs? I have been loosing records from my database and my best guess is that each tab is not a separate session, therefore the session variables are shared by all tabs and unfortunately this plays havoc when I try to update my database using the forms I have created. Is there anyway to...
9
468
by: strycat | last post by:
Hello, I've got two different sets of ASP scripts on my server. Each set is kept in their own directory. Both sets of scripts use sessions. I want to make sure that the sessions are not accidentially shared between the two sets as they are both different applications. Right now I'm having a problem when I do a Session.Abandon from one set of scripts it also kills the session for the other set of scripts (I believe they are both...
10
2893
by: newbie | last post by:
My application_end event in global.asax is not working as-is. In order to debug, I want to call it from another file, say debug.aspx through a button, e.g. "end application". How do I call application_end in global.asax from debug.aspx? thanks
9
3244
by: AndersBj | last post by:
Hi all, I have a web application that uses State Server for session handling. The web application randomly loses all session variables. The sessions are not always lost, sometimes I can use the application for a day or so, and sometimes the sessions are lost every 5 minutes. I've read some discussions about different things that cause the application to restart and then lose its sessions. But this only occurs when using InProc as...
5
1910
by: Andy | last post by:
I have an admin section of my asp.net 2 application, and I want to be able to automatically login as a different user (Forms Authentication) whilst keeping my current session going too. The problem is that if I open a new browser window (via a hyperlink using target="_blank") from my app and automatically login, the original session is also reset to the new one (ie all session variables that store info about the user are set to the new...
0
8367
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8279
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
8811
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
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...
0
7302
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4145
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
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1591
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.