473,324 Members | 2,511 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,324 software developers and data experts.

Is session variable valid for second explorer windows.

i am running php script which creates session and stores some value in
session variables. then this file calls the another php script which
displays the values stored in session variables.

as far as i have no problem. but after running above steps, i am
leaving the explorer open. then i am opening new explorer and running
directly the second php script. this script displays the values stored
in session variables. should this happen????????

according to me this should not happen because session is related with
opened browser window and not with browser.

guide me regarding this........

thxs for help in advance

Jul 17 '05 #1
4 2271
vishal wrote:
i am running php script which creates session and stores some value in
session variables. then this file calls the another php script which
displays the values stored in session variables.

as far as i have no problem. but after running above steps, i am
leaving the explorer open. then i am opening new explorer and running
directly the second php script. this script displays the values stored
in session variables. should this happen????????
Yes.

according to me this should not happen because session is related with
opened browser window and not with browser.
You understood wrong.

This is how it works:
A browser has stored a serie of cookies from certain sites.
One of them is PHPSESSIONID (or whatever you decided to call it), and that
cookie contains a number: your sessionid.

If you open a new window, AND visit a site that is found in your cookies,
that corresponding cookie is send with the request.

So you share the same session between windows.

Tip:
If you don't want this behavious during development:
On Mozilla you have the oppertunity to create different profiles.
Each profile contains their own set of cookies.
So you CAN open two windows that do not share the same set of cookies.

I use that approach often during development, when I don't want to log out
and log in again as a different user.
EG: In one window(profile) I am admin, and in the other I am a normal user.
But you cannot expect your visitors to do the same.

Hope that helps.

Regards,
Erwin Moller

guide me regarding this........

thxs for help in advance


Jul 17 '05 #2
vishal <vi************@yahoo.co.in> wrote:
[session]
as far as i have no problem. but after running above steps, i am
leaving the explorer open. then i am opening new explorer and running
directly the second php script. this script displays the values stored
in session variables. should this happen???????? according to me this should not happen because session is related with
opened browser window and not with browser.

guide me regarding this........


Depends, with explorer you mean IE? How do you open the new one? IIRC
you can create a new window in 2 ways:
-open new window from within running one
-start new instance (IIRC configurable somehwere in the bloddy thing)

The first one will share session cookies, the second one doesn't.

Jul 17 '05 #3
"vishal" <vi************@yahoo.co.in> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
i am running php script which creates session and stores some value in
session variables. then this file calls the another php script which
displays the values stored in session variables.

as far as i have no problem. but after running above steps, i am
leaving the explorer open. then i am opening new explorer and running
directly the second php script. this script displays the values stored
in session variables. should this happen????????

according to me this should not happen because session is related with
opened browser window and not with browser.

guide me regarding this........

thxs for help in advance


It's a confusing subject. As Daniel pointed out, session cookies are shared
between IE windows if they belong to the same IE process. An IE windows
opened from/by another IE window is owned by the process of that window.
There are a number of way where this happens:

1) File > New > Window
2) Right click > Open in new window
3) target attribute in anchor and form tags
4) javascript open()

Browser windows that are opened from the start menu, the task bar, or by
double clicking on iexplore.exe, are owned by different processes, so they
do not share session cookies. The exception to that is when the computer has
less than 32meg of RAM, in which case there's always only one instance of
IE.

Persistent cookies are always shared between browser windows, provided that
the domain name matches.
Jul 17 '05 #4
thxs for reply.

you cleared my doubts

Jul 17 '05 #5

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

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
2
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals...
3
by: Rob Locher | last post by:
I have a server running NT 4 Server that is on my local domain that hosts an ASP application. I have a problem: when I try to test the ASP application from a computer on the same domain running...
1
by: Gary | last post by:
i have a project which is include ASP, VB, VB COM, MTS, IIS. when the user enter the site the user is asked to login using UserID and Password after that i am passing those values to COM Objects...
0
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
26
by: BillE | last post by:
Some ASP.NET applications use Session Variables extensively to maintain state. These should be re-written to use viewstate, hidden fields, querystring, etc. instead. This is because if a user...
25
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.