Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Session time-out

    Thanks George, Kevin. I think I need to clarify. I wasn't
    expecting the browser to be smart enough to know when a
    session did terminate, neither trying to implement a
    timer of any kind.

    I completely understand (and I have tested it) that the
    only way for the web server to know that a session has
    timed-out is by placing a request to the server.

    I assumed that this was understood in my e-mail. I am
    going to clarify all this by saying that after the
    session timed-out and after a request has been placed,
    the redirection code that I put in the Global.asax.vb
    file did not working.

    I have already found a work around. So in the mean time I
    will use what I came up with.

    If any of you know of the "right" way of doing this,
    please let me know.

    Thank you both.
    >-----Original Message-----
    >You must understand that Server has does not get
    notification when user id
    >taking a coffee brake nor closed the browser.
    >
    >
    >So Session times out 20(configurable) minutes after last
    request.
    >The key here "Last Request" meaning that time out
    happens when there is no
    >request.
    >So there is no one to redirect.
    >
    >George.
    >
    >"Marcelo" <mareal@remember.com> wrote in message
    >news:694d01c3583f$fd62a430$a001280a@phx.gbl...
    >> What's secret for the user to be automatically
    redirected
    >> to the login page when a session has timed-out?
    >>
    >> I have tried adding the following line:
    >>
    >> System.Web.HttpContext.Current.Response.Redirect
    >> ("login.aspx")
    >>
    >> in the Global.asax.vb file under the following method
    >>
    >> Sub Session_End(ByVal sender As Object, ByVal e As
    >> EventArgs)
    >>
    >> But it does not work.
    >>
    >> Thanks in advance.
    >
    >
    >.
    >
    Marcelo Guest

  2. Similar Questions and Discussions

    1. how i can set session time out peiod
      hi all, How i can set the session time out period of asp.net session.Since i am anovice programmer it will be very helpful if u give details...
    2. Session time outs
      I have a user authentication system in my application that allows you to log in and view certain areas of the site based on a session variable. I?m...
    3. Session Time Out
      Hello i'am using dreamveaver mx 2004 i want to know how i can control Session Ex: i want it to be for 30 minutes and then expire???
    4. Session one more time
      Hi, I have a login page (without frames). After the user login s/he lands on the site with 2 frames. Their names are top and bottom. I post the...
    5. session time
      To: All I have some question how can do it when the session timeout after that will propmt the message and redirect to login page for login...
  3. #2

    Default RE: Session time-out

    Thanks George, Kevin for the replies.

    Hi Marcelo,

    You can use Response.AddHeader("Refresh",Convert.ToString
    ((Session.Timeout+ 1))) in Page_Load to cause the page refresh when the
    session is timeout. You also can use
    "Response.AddHeader("Refresh",Convert.ToString ((Session.Timeout+
    1))+";URL=login.aspx")" to redirect the page to login page.

    Check this link, I think it is helpful.

    [url]http://www.4guysfromrolla.com/webtech/tips/t022800-1.shtml[/url]

    Please let me know if you need more information.

    Best Regards,
    Lewis

    Get Secure! - [url]www.microsoft.com/security[/url]
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    | Content-Class: urn:content-classes:message
    | From: "Marcelo" <mareal@remember.com>
    | Sender: "Marcelo" <mareal@remember.com>
    | Subject: Session time-out
    | Date: Fri, 1 Aug 2003 08:17:15 -0700
    | Lines: 16
    | Message-ID: <694d01c3583f$fd62a430$a001280a@phx.gbl>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="iso-8859-1"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    | Thread-Index: AcNYP/1ixP3l7y5oSCGj2MVbJiRZKw==
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | Path: cpmsftngxa06.phx.gbl
    | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:164149
    | NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | What's secret for the user to be automatically redirected
    | to the login page when a session has timed-out?
    |
    | I have tried adding the following line:
    |
    | System.Web.HttpContext.Current.Response.Redirect
    | ("login.aspx")
    |
    | in the Global.asax.vb file under the following method
    |
    | Sub Session_End(ByVal sender As Object, ByVal e As
    | EventArgs)
    |
    | But it does not work.
    |
    | Thanks in advance.
    |

    Lewis Wang [MSFT] Guest

  4. #3

    Default Re: Session time-out


    "Lewis Wang [MSFT]" <v-lwang@online.microsoft.com> wrote in message
    news:vZfUZayWDHA.2192@cpmsftngxa06.phx.gbl...
    > Thanks George, Kevin for the replies.
    >
    > Hi Marcelo,
    >
    > You can use Response.AddHeader("Refresh",Convert.ToString
    > ((Session.Timeout+ 1))) in Page_Load to cause the page refresh when the
    > session is timeout. You also can use
    > "Response.AddHeader("Refresh",Convert.ToString ((Session.Timeout+
    > 1))+";URL=login.aspx")" to redirect the page to login page.
    >
    Watch out: Session.Timeout is in minutes and Refresh works in seconds!
    You need to work a " * 60 " in there.

    Hans Kesting
    > Check this link, I think it is helpful.
    >
    > [url]http://www.4guysfromrolla.com/webtech/tips/t022800-1.shtml[/url]
    >
    > Please let me know if you need more information.
    >
    > Best Regards,
    > Lewis
    >
    > Get Secure! - [url]www.microsoft.com/security[/url]
    > This posting is provided "AS IS" with no warranties, and confers no
    rights.
    >
    > --------------------
    > | Content-Class: urn:content-classes:message
    > | From: "Marcelo" <mareal@remember.com>
    > | Sender: "Marcelo" <mareal@remember.com>
    > | Subject: Session time-out
    > | Date: Fri, 1 Aug 2003 08:17:15 -0700
    > | Lines: 16
    > | Message-ID: <694d01c3583f$fd62a430$a001280a@phx.gbl>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="iso-8859-1"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    > | Thread-Index: AcNYP/1ixP3l7y5oSCGj2MVbJiRZKw==
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    > | Path: cpmsftngxa06.phx.gbl
    > | Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet:164149
    > | NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > |
    > | What's secret for the user to be automatically redirected
    > | to the login page when a session has timed-out?
    > |
    > | I have tried adding the following line:
    > |
    > | System.Web.HttpContext.Current.Response.Redirect
    > | ("login.aspx")
    > |
    > | in the Global.asax.vb file under the following method
    > |
    > | Sub Session_End(ByVal sender As Object, ByVal e As
    > | EventArgs)
    > |
    > | But it does not work.
    > |
    > | Thanks in advance.
    > |
    >

    Hans Kesting Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139