session_end and re-login

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

  1. #1

    Default session_end and re-login

    Dear ASP.NET Programmers,

    I am using forms authentication in my web application. I would like the
    users to be transferred to the login page when the session expires. I am
    using session state, but the following code in global.asax file does not
    work:

    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    FormsAuthentication.SignOut()
    Response.Redirect("login.aspx")
    End Sub

    How can I solve this problem or work around it?

    Buran



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Burak Kadirbeyoglu Guest

  2. Similar Questions and Discussions

    1. Strange problem with Forms authentication: After successfull login, login page is still displayed
      Hi there I have a quite strange problem with my ASP.NET-Application. The application has being deployed one year ago and worked fine till last...
    2. session problem - login screen continually reloads after pressing the login button
      I am trying to get sessions to work on a log in screen to give certain users access to certain pages/directories. The problem is that when the...
    3. Session lasting too long -- Session_End event firing way late !! ??
      Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more...
    4. Session_End never fires
      I've got an ASP.NET page with a counter subtraction routine in the Session_End method in the Global.asax.cs: protected void Session_End(Object...
    5. Session_End Not Firing
      Hey guys I have a user tracking setup to track users. What it does is once a user hits my site it sends me an email telling me some info and once a...
  3. #2

    Default session_end and re-login

    If your pages/directories are marked with <allow>/<deny>
    in the Web.config file, then when the session expires,
    the user will be redirected to the login page
    automatically when they access the page.

    Tu-Thach
    >-----Original Message-----
    >Dear ASP.NET Programmers,
    >
    >I am using forms authentication in my web application. I
    would like the
    >users to be transferred to the login page when the
    session expires. I am
    >using session state, but the following code in
    global.asax file does not
    >work:
    >
    >Sub Session_End(ByVal sender As Object, ByVal e As
    EventArgs)
    > FormsAuthentication.SignOut()
    > Response.Redirect("login.aspx")
    >End Sub
    >
    >How can I solve this problem or work around it?
    >
    >Buran
    >
    >
    >
    >*** Sent via Developersdex [url]http://www.developersdex.com[/url]
    ***
    >Don't just participate in USENET...get rewarded for it!
    >.
    >
    Tu-Thach 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