469,625 Members | 1,089 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

Stopping multiple browsers getting session state

Is it possible to programmatically stop multiple browsers from getting
the same session state?

The problem I have is that whenever I open a new browse using File-
>New Window, the session state gets transferred to this new window.
I would like to stop this from happening and redirect to the homepage.

Thanks in advance!

Jun 13 '07 #1
5 2432
Unfortunately, no, as this is a property of the browser. You can set up a
method to "sync" state, but it is generally more of a pain than it is worth.
Technically, you can boot the second browser, but how do you determine it
the new instance other than an old, except perhaps "second time user hits
same page with same info". Unfortunately, all you can try to do then is
pitch the browser.

With JavaScript you can alter the way the browser works and stop some things
from happening, but I am not certain that is your goal.

Now, if this is a testing thing, open a new browser from the menu, not
Contol + N.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
"jediknight" <wa*****@gmail.comwrote in message
news:11*********************@e26g2000pro.googlegro ups.com...
Is it possible to programmatically stop multiple browsers from getting
the same session state?

The problem I have is that whenever I open a new browse using File-
>>New Window, the session state gets transferred to this new window.

I would like to stop this from happening and redirect to the homepage.

Thanks in advance!

Jun 13 '07 #2
Hello Cowboy (Gregory A. Beamer),

I'd add that OP perhaps may intercepts postbacks and generate GUID for the
each page.
Then comparing IDs he could know whether he new window was opened, because
the new guid will be generated

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

CUnfortunately, no, as this is a property of the browser. You can set
Cup a method to "sync" state, but it is generally more of a pain than
Cit is worth. Technically, you can boot the second browser, but how do
Cyou determine it the new instance other than an old, except perhaps
C"second time user hits same page with same info". Unfortunately, all
Cyou can try to do then is pitch the browser.
C>
CWith JavaScript you can alter the way the browser works and stop some
Cthings from happening, but I am not certain that is your goal.
C>
CNow, if this is a testing thing, open a new browser from the menu,
Cnot Contol + N.
C>
C************************************************ Think outside the
Cbox! ************************************************ "jediknight"
C<wa*****@gmail.comwrote in message
Cnews:11*********************@e26g2000pro.googlegr oups.com...
C>
>Is it possible to programmatically stop multiple browsers from
getting the same session state?

The problem I have is that whenever I open a new browse using File-
>>New Window, the session state gets transferred to this new window.
I would like to stop this from happening and redirect to the
homepage.

Thanks in advance!

Jun 13 '07 #3
unless the browser caches the page, then both browser instances have the
same guid. be sure to handle this case. to the server it looks like a
page refresh.
this happens because new window creates a new browser instance with the
same context, so they share the same session cookies. if cookieless, the
session id is in the url (which they share).

-- bruce (sqlwork.com)

Michael Nemtsev wrote:
Hello Cowboy (Gregory A. Beamer),

I'd add that OP perhaps may intercepts postbacks and generate GUID for
the each page.
Then comparing IDs he could know whether he new window was opened,
because the new guid will be generated

---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and
we miss it, but that it is too low and we reach it" (c) Michelangelo

CUnfortunately, no, as this is a property of the browser. You can set
Cup a method to "sync" state, but it is generally more of a pain than
Cit is worth. Technically, you can boot the second browser, but how do
Cyou determine it the new instance other than an old, except perhaps
C"second time user hits same page with same info". Unfortunately, all
Cyou can try to do then is pitch the browser.
CCWith JavaScript you can alter the way the browser works and stop some
Cthings from happening, but I am not certain that is your goal.
CCNow, if this is a testing thing, open a new browser from the menu,
Cnot Contol + N.
CC************************************************ Think outside the
Cbox! ************************************************ "jediknight"
C<wa*****@gmail.comwrote in message
Cnews:11*********************@e26g2000pro.googlegr oups.com...
C>
>>Is it possible to programmatically stop multiple browsers from
getting the same session state?

The problem I have is that whenever I open a new browse using File-

New Window, the session state gets transferred to this new window.

I would like to stop this from happening and redirect to the
homepage.

Thanks in advance!

Jun 13 '07 #4
jediknight wrote:
Is it possible to programmatically stop multiple browsers from getting
the same session state?

The problem I have is that whenever I open a new browse using File-
>New Window, the session state gets transferred to this new window.

I would like to stop this from happening and redirect to the homepage.

Thanks in advance!
You can't stop that from happening. All windows in the same browser
instance belong to the same session.

Also, all browsers doesn't even use separate browser instances. If you
start a new instance of the FireFox program, for example, it will
instead open a new window in the existing instance.

If you want any information to be page specific rather than session
specific, you have to send the information within the page itself.

--
Göran Andersson
_____
http://www.guffa.com
Jun 13 '07 #5
Hello Bruce,

BBto the server it looks like a page refresh.

Exactly. so it helps to prevent the refreshed, afaik

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Jun 14 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by jing_li | last post: by
1 post views Thread by Tim Meagher | last post: by
10 posts views Thread by Conformix Sales | last post: by
1 post views Thread by jack_c_brinegar | last post: by
4 posts views Thread by jack | last post: by
1 post views Thread by mcbobin | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.