Results 1 to 2 of 2

Thread: Timeout Problem

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jul 2002
    Posts
    80

    Question Timeout Problem

    I created a log-on form that verifies a username and password to username/password fields in a database. If the user is a valid user, I create a session variable and assign it the username. I use this session variable for security throughout the web application. My problem is after 20 minutes the session state restart and the session variable no longer has the username assigned to it and my security is lost. Is there a way that I can redirect the user to the log-on screen if the session times out? I don't want to increase the timeout in the web.config file since some users may leave the browse open for a unpredictable amount of time.

    Thanks,

    James

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Try this
    Code:
    if(Session["username"] == null)
    {
        Response.Redirect("Logon.aspx");
    }
    Dont gain the world and lose your soul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width