PC Review


Reply
Thread Tools Rate Thread

Detecting timeout with multiple websites on the same IIS server

 
 
Rob
Guest
Posts: n/a
 
      10th Oct 2007
> This works - sort of. It works by checking to see if the ASP.NET_SessionId
> cookie exists when a new session is started. If it is present, then this
> is (supposed) to indicate that it's a new session.


Sorry that should have read "(supposed) to indicate that it's a *timed out*
session".

Cheers, Rob.


 
Reply With Quote
 
 
 
 
Rob
Guest
Posts: n/a
 
      10th Oct 2007
I'm using the well documented code to detect whether a timeout has occurred
when a page is fetched in the OnInit() event handler:

If Session.IsNewSession Then
Dim CookieHeader As String = Request.Headers("Cookie")
If Not CookieHeader Is Nothing AndAlso
CookieHeader.IndexOf("ASP.NET_SessionId") >= 0 Then
Request.Redirect("~/Timeout.aspx")
End If
End IF

This works - sort of. It works by checking to see if the ASP.NET_SessionId
cookie exists when a new session is started. If it is present, then this is
(supposed) to indicate that it's a new session.

However, if you have two applications running on the same IIS web server,
then it triggers incorrectly. Both applications implement the above code.

1. Open http://localhost/webapp1/default.aspx
2. IsNewSession is true but cookie isn't present
3. Open http://localhost/webapp2/default.aspx
4. IsNewSession is true but the ASP.NET_SessionId cookie also exists (why is
this?)

Therefore the user is directed to the timeout page of webapp2.

I've tried adding setting the path (in Session_Start event) of the
Response.Cookie("ASP.NET_SessionId" to Request.PhysicalApplicationPath but
that doesn't seem to make any difference.

Any ideas?

Thanks, Rob.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting a session timeout Sems Microsoft ASP .NET 4 5th Feb 2008 05:50 PM
Detecting Session Timeout =?Utf-8?B?TWlrZQ==?= Microsoft ASP .NET 7 9th Nov 2006 08:47 PM
Some websites not detecting Flash =?Utf-8?B?S2F0aHJ5bg==?= Windows XP Help 1 10th Oct 2005 02:58 PM
How Do You Detecting Session Timeout? Chris Newby Microsoft ASP .NET 4 6th May 2005 06:18 PM
Deploy web application to multiple websites on same server. Mark Starkman Microsoft ASP .NET 1 2nd Mar 2004 10:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:48 AM.