Saturday, August 19

Asp.Net Session timeout about to happen Warning?

Any idea about how to implement the autoclose Session timeout windows that some bank websites imlement?

I have been playing with giving the user an alert before a session timeout in a secure website.Here is a basic method that I found.
/*************************************************************************/

int int_MilliSecondsTimeOut = (this.Session.Timeout * 60000) - 120000;
string str_Script = @"
function Reconnect()
{
alert('Session is about to Timeout in 2 minutes.\n Please complete work and submit');
}
window.setInterval('Reconnect()'," + int_MilliSecondsTimeOut.ToString() + @");
";
Page.RegisterClientScriptBlock("Reconnect", str_Script);

/*************************************************************************/

This javascript method gets called 2 minutes before a Session timeout but it needs user attention and doesn't autoclose (render useless after timeout period expires) and log the user out.

One way could be using Form Authentication in Asp.Net.

Ideas welcome.

P.S.

javascript Script tages seems to be banned in blogger, while yahoo 360 blogs allow it. ;)

I think applying HtmlEncode() solves the security and page beaking issue. I think that what nneeds to be done whenever projects which use FCKeditor have to do in order to allow users to create text with html tags in it.

Comments:
We could also use the ATLAS Asp.net built in controls like the modal popup, that came across today.

http://atlas.asp.net/atlastoolkit/ModalPopup/ModalPopup.aspx

I am thinking the bank websites use these popups to get the user to click on them to get to the page but also close off at a set time.

User cn be taken to loin page using Form security after session timeout.
 
Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]