Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

Stopping multiple browsers getting session state

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jediknight - 13 Jun 2007 13:34 GMT
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!
Cowboy (Gregory A. Beamer) - 13 Jun 2007 13:41 GMT
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.

Signature

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

> Is it possible to programmatically stop multiple browsers from getting
> the same session state?
[quoted text clipped - 5 lines]
>
> Thanks in advance!
Michael Nemtsev - 13 Jun 2007 14:04 GMT
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> <wakthar@gmail.com> wrote in message
C> news:1181738060.735118.83670@e26g2000pro.googlegroups.com...
C>
>> Is it possible to programmatically stop multiple browsers from
>> getting the same session state?
[quoted text clipped - 7 lines]
>>
>> Thanks in advance!
bruce barker - 13 Jun 2007 16:33 GMT
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)

> Hello Cowboy (Gregory A. Beamer),
>
[quoted text clipped - 37 lines]
>>>
>>> Thanks in advance!
Michael Nemtsev - 14 Jun 2007 09:45 GMT
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
Göran Andersson - 13 Jun 2007 17:01 GMT
> Is it possible to programmatically stop multiple browsers from getting
> the same session state?
[quoted text clipped - 5 lines]
>
> 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.

Signature

Göran Andersson
_____
http://www.guffa.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.