setting a condition for a session timeout in page code behind ? RRS feed

  • Question

  • User1987180197 posted


    Till know i have used FormsAuthentication for login system in my site but due to some requirement i need to use sessions. The requirement is basically for Captcha control which i have developed using Random class and saving the captcha code it in Session["Captcha"].

    Now on the login button click i need to check like this if (this.txtCaptcha.Text == this.Session["Captcha"].ToString()) and then proceed with the required logic. Due to strict limit on sessionstate (i.e 5 min only) i need to check on the session timeout condition otherwise its giving object not referenced error if the user stays for some time on the login page and then click the submit button.

     I need to handle this in page code behind because i have two login pages for my site, one for normal users and for Administration.

    Any type of help will be beneficial.


    Thursday, November 15, 2012 7:33 AM


All replies