C
christine.nguyen
I am using Forms Authentication under Windows Server 2003 in .NET
2.0. It appears that the auth ticket is expiring when it's supposed
to but it doesn't automatically redirect the user to the login page.
Here is some watered down sample code I had to put in the onLoad of my
page in order to properly redirect the user upon expiration of the
login. It appears that once the auth ticket is expired, the name of
the Identity is lost (which makes sense) and then I redirect the user.
protected override void OnLoad(EventArgs e)
string userName = HttpContext.Current.User.Identity.Name;
if(String.IsNullOrEmpty(userName)
Response.Redirect(redirectUrl);
}
My question is whether I really have to include such code in my page
to handle the the empty Identity name or should the framework be
redirecting on its own once the auth ticket has expired and the
identity name is empty?
Thanks,
Christine
2.0. It appears that the auth ticket is expiring when it's supposed
to but it doesn't automatically redirect the user to the login page.
Here is some watered down sample code I had to put in the onLoad of my
page in order to properly redirect the user upon expiration of the
login. It appears that once the auth ticket is expired, the name of
the Identity is lost (which makes sense) and then I redirect the user.
protected override void OnLoad(EventArgs e)
string userName = HttpContext.Current.User.Identity.Name;
if(String.IsNullOrEmpty(userName)
Response.Redirect(redirectUrl);
}
My question is whether I really have to include such code in my page
to handle the the empty Identity name or should the framework be
redirecting on its own once the auth ticket has expired and the
identity name is empty?
Thanks,
Christine