Session expired....

  • Thread starter Thread starter Peter Smith
  • Start date Start date
P

Peter Smith

Will the below statement returns TRUE or FALSE iif the session is expired?

(Request.UrlReferrer) Is Nothing

I am using ASP.Net 1.1 and IIS 5.0.

Thanks,

Smith
 
They are independant. The only thing that fiddles with the referrer is the
use who may choose to hide it for privacy reasons.

BTW In the HTTP Standard (at a code-level) referrer is misspelt: 'referer'.

Cheers,
Tom Pester
 
Try this if you want to see if the session has expired. I forgot where I
found this but I thank them just the same!

private void CheckForSessionTimeout(){
if (Context.Session != null){
if (Session.IsNewSession){
string szCookieHeader = Request.Headers["Cookie"];
if ((null != szCookieHeader) &&
(szCookieHeader.IndexOf("ASP.NET_SessionId") >= 0)){
Response.Redirect(this.ResolveUrl("~/sessionTimeout.aspx"));
}
}
}
}
 

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

Back
Top