Stopping multiple browsers getting session state

J

jediknight

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!
 
C

Cowboy \(Gregory A. Beamer\)

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.
 
M

Michael Nemtsev

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

C> Unfortunately, no, as this is a property of the browser. You can set
C> up a method to "sync" state, but it is generally more of a pain than
C> it is worth. Technically, you can boot the second browser, but how do
C> you determine it the new instance other than an old, except perhaps
C> "second time user hits same page with same info". Unfortunately, all
C> you can try to do then is pitch the browser.
C>
C> With JavaScript you can alter the way the browser works and stop some
C> things from happening, but I am not certain that is your goal.
C>
C> Now, if this is a testing thing, open a new browser from the menu,
C> not Contol + N.
C>
C> ************************************************ Think outside the
C> box! ************************************************ "jediknight"
C> C>
 
B

bruce barker

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 said:
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

C> Unfortunately, no, as this is a property of the browser. You can set
C> up a method to "sync" state, but it is generally more of a pain than
C> it is worth. Technically, you can boot the second browser, but how do
C> you determine it the new instance other than an old, except perhaps
C> "second time user hits same page with same info". Unfortunately, all
C> you can try to do then is pitch the browser.
C> C> With JavaScript you can alter the way the browser works and stop some
C> things from happening, but I am not certain that is your goal.
C> C> Now, if this is a testing thing, open a new browser from the menu,
C> not Contol + N.
C> C> ************************************************ Think outside the
C> box! ************************************************ "jediknight"
C> C>
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

jediknight said:
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-

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.
 
M

Michael Nemtsev

Hello Bruce,

BB> to 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top