473,386 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

sessions not available to different browser window.

Hi Folks,

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

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

if i call session_write.php and then session_read.php in the same browser
window all is fine. but if i call session_read.php 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 3534
When you open up another browser window you are effectively creating a new
session.

Tony Marston

"Simon" <si***@nospami-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.php
///////////////////
session_start();
$_SESSION['A'] = 'AAA';
print("sA". $_SESSION['A']);
//////////////////////
and session_read.php
//////////////////
session_start();
if (isset ($_SESSION['A']))
{
print ('sessions set');
}
else{
print ('sessions not set');
}

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

if i call session_write.php and then session_read.php in the same browser
window all is fine. but if i call session_read.php 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.php
///////////////////
session_start();
$_SESSION['A'] = 'AAA';
print("sA". $_SESSION['A']);
//////////////////////
and session_read.php
//////////////////
session_start();
if (isset ($_SESSION['A']))
{
print ('sessions set');
}
else{
print ('sessions not set');
}

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

if i call session_write.php and then session_read.php in the same browser
window all is fine. but if i call session_read.php 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
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...
4
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...
4
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...
22
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...
17
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...
9
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...
10
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...
9
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
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,...
0
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...

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.