Re: how to time out the web asp.net application when not in use for 15 minutes

From: Brock Allen (ballen_at_develop.com.i_hate_spam_too)
Date: 03/16/05


Date: Wed, 16 Mar 2005 14:55:17 -0800

As I suggested before you either need to add a check to every page to do
the redirect or you should be using Forms Authentication to to track the
user. I really think you'll have an easier time adopting Forms authentication.
Here's an article that should get you started:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconASPNETAuthentication.asp

-Brock
DevelopMentor
http://staff.develop.com/ballen

> Actually what i want to convey is
> when the session is time out asp.net application goes to session_end
> event
> (the code is shown below)after rumnning the event it stays in the
> same page
> .I want to transfer to sessionTimeOut.aspx page .But beacause
> Session_End
> fires outside of a Request into your system I can't use
> Response.Redirect.
> How do I redirect now?
>
> Regards
>
> protected void Session_End(Object sender, EventArgs e)
>
> {
>
> if (Session["SessionID"] != null)
>
> {
>
> try
>
> {
>
> string LogoutURL="../Public/SessionTimeOut.aspx";
>
> ESMSecurityModule.killSession(Session["SessionID"].ToString());
>
> Session.Clear();
>
> Session.Abandon();
>
> Response.Redirect(LogoutURL);
>
> }
>
> catch
>
> {
>
> }
>
> }
>
> }
>
> How to timing out the asp.net web application when not in use for 15
>
>>>> minutes although I am using the code in web.config file as below:
>>>>
>>>> <authentication mode="Forms">
>>>> <forms loginUrl="Security/Login.aspx" protection="All" timeout="20"
>>>> path="/" />
>>>> </authentication>
> "Brock Allen" <ballen@develop.com.i_hate_spam_too> wrote in message
> news:16148632465578650967312@msnews.microsoft.com...
>
>> Session_End fires outside of a Request into your system. So since
>> there's no request, there's no where to transfer to. When you should
>> do is check upon the next request to see if your Session data is
>> gone, and if so take the appropriate actions.
>>
>> Now, since you've mentioned a login page, why are you using Session
>> state to track to see if the user's logged in? You should be using
>> Forms authentication, as this does all the necessary work to redirect
>> the user to a login page if they're not currently logged in.
>>
>> -Brock
>> DevelopMentor
>> http://staff.develop.com/ballen
>>> Actually when session is timeout (20 minutes) it goes to
>>> session_end
>>> event
>>> in glaobal.asax.cs but i don't know how to transfer from this point
>>> to
>>> login
>>> page
>>> Can anyone help me !
>>> Regards
>>> "enahar" <enahar@hotmail.com> wrote in message
>>> news:%23pQOIyKFFHA.936@TK2MSFTNGP12.phx.gbl...
>>>> Hi,
>>>>
>>>> How to timing out the asp.net web application when not in use for
>>>> 15 minutes although I am using the code in web.config file as
>>>> below:
>>>>
>>>> <authentication mode="Forms">
>>>> <forms loginUrl="Security/Login.aspx" protection="All" timeout="20"
>>>> path="/" />
>>>> </authentication>
>>>> Thanks
>>>>



Relevant Pages

  • Re: Each HTTP object being requested twice (401 then 200 responses)
    ... Authentication" and the web.config authentication setting is ... Authorized because the request was made anonymously. ... requests the same object a second time it uses kerberos; ... pass a session ID cookie and therefore succeed the first time. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Why IAS get stuck on authenticating PEAP (MS-CHAP2) clients
    ... processed the request and sent message for which it expects response. ... could be that packet some how did not reach the client or client decided to ... > We are trying to implement PEAP security authentication using ... > session has ...
    (microsoft.public.internet.radius)
  • RE: Redirect to default page using Windows Authentication
    ... The webserver may get intercept the request and return ... that error before I can do any type of redirect on the ... >authentication works is that if the resource you are ... >>confers no rights. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Forms Authentication, Roles Authorization, Session Variables and Application_AuthenticateRequest
    ... I am using Forms authentication with Roles authorization. ... > trying to get Roles in Application_AuthenticateRequest from a Session ... but I received the same error as the guy bellow: Session state ... > control the request to session variable only if request was authenticated. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Gracefully Handling Logged Out User
    ... > Session has nothing to do with Forms Authentication. ... > automatically redirect them to the login page. ... > The one issue you'll see is that, if the request which required ...
    (microsoft.public.dotnet.framework.aspnet)