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

Discussion in 'ASP .Net Security' started by enahar, Feb 17, 2005.

  1. enahar

    enahar Guest

    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
    enahar, Feb 17, 2005
    #1
    1. Advertising

  2. enahar

    PL Guest

    20 is not 15 :)

    You also need to disable slidingExpiration by setting it to false
    and you need to make sure you dont set the cookie as persistant
    in your forms login.

    Assuming you have the .NET Framwework SDK with docs installed try this link:
    ms-help://MS.NETFrameworkSDKv1.1/cpgenref/html/gngrfforms.htm

    PL.

    "enahar" <> skrev i meddelandet news:%...
    > 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
    >
    >
    >
    >
    PL, Feb 17, 2005
    #2
    1. Advertising

  3. enahar

    Ekta Agarwal Guest

    Hi

    If I use the sliding Expiration in the code(web.config) as follows:

    <authentication mode="Forms" >

    <forms loginUrl="Security/Login.aspx" protection="All" slidingExpiration
    ="true" timeout="15" path="/" />

    </authentication>



    I am getting the following error message:


    Parser Error Message: Unrecognized attribute 'slidingExpiration'.

    Source Error:

    Line 31: -->
    Line 32: <authentication mode="Forms" >
    Line 33: <forms loginUrl="Security/Login.aspx" protection="All"
    slidingExpiration ="true" timeout="15" path="/" />
    Line 34: </authentication>
    Line 35:




    How and where do I use the SlidingExpiration attribute.

    Thanks



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Ekta Agarwal, Feb 17, 2005
    #3
  4. enahar

    PL Guest

    Please have a look at this page:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfforms.asp

    PL.


    "Ekta Agarwal" <> skrev i meddelandet news:...
    > Hi
    >
    > If I use the sliding Expiration in the code(web.config) as follows:
    >
    > <authentication mode="Forms" >
    >
    > <forms loginUrl="Security/Login.aspx" protection="All" slidingExpiration
    > ="true" timeout="15" path="/" />
    >
    > </authentication>
    >
    >
    >
    > I am getting the following error message:
    >
    >
    > Parser Error Message: Unrecognized attribute 'slidingExpiration'.
    >
    > Source Error:
    >
    > Line 31: -->
    > Line 32: <authentication mode="Forms" >
    > Line 33: <forms loginUrl="Security/Login.aspx" protection="All"
    > slidingExpiration ="true" timeout="15" path="/" />
    > Line 34: </authentication>
    > Line 35:
    >
    >
    >
    >
    > How and where do I use the SlidingExpiration attribute.
    >
    > Thanks
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    PL, Feb 18, 2005
    #4
  5. enahar

    Ekta Agarwal Guest

    Hi,

    I am still getting the same error message after looking into the URL you
    have sent..

    Regards,



    Server Error in '/PITSHWebUI' Application.
    ------------------------------------------------------------------------
    --------

    Configuration Error
    Description: An error occurred during the processing of a configuration
    file required to service this request. Please review the specific error
    details below and modify your configuration file appropriately.

    Parser Error Message: Unrecognized attribute 'slidingExpiration'.

    Source Error:


    Line 32: <authentication mode="Forms" >
    Line 33: <!--<forms loginUrl="Security/Login.aspx" protection="All"
    slidingExpiration="false" timeout="15" path="/" />-->
    Line 34: <forms name="name" loginUrl="Security/Login.aspx"
    protection="All" timeout="15" path="/" slidingExpiration="true">
    Line 35: </forms>
    Line 36:


    Source File: c:\inetpub\wwwroot\PITSHWebUI\web.config Line: 34


    ------------------------------------------------------------------------
    --------
    Version Information: Microsoft .NET Framework Version:1.0.3705.6018;
    ASP.NET Version:1.0.3705.6018

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Ekta Agarwal, Feb 18, 2005
    #5
  6. enahar

    PL Guest

    I cannot see anything wrong in your code below but obviously you must have an error in spelling or casing or
    something like that.

    PL.


    "Ekta Agarwal" <> skrev i meddelandet news:...
    > Hi,
    >
    > I am still getting the same error message after looking into the URL you
    > have sent..
    >
    > Regards,
    >
    PL, Feb 18, 2005
    #6
  7. enahar

    Ekta Agarwal Guest

    Hi,

    I have checked the spelling, casing .
    Still I can't use the slidingExpiration attribute in the Forms tag .I am
    getting the same error message
    '' Unrecognized attribute 'slidingExpiration' ''
    Can anybody help me why?

    Thanks

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Ekta Agarwal, Feb 21, 2005
    #7
  8. enahar

    PL Guest

    Try installing ASP.NET 1.1, you are probably running 1.0 ?

    Downlaod from:
    http://www.asp.net/download-1.1.aspx?tabindex=0&tabid=1

    Of ocurse, if you dont have control over the server this poses a problem.

    PL.

    "Ekta Agarwal" <> skrev i meddelandet news:%...
    >
    > Hi,
    >
    > I have checked the spelling, casing .
    > Still I can't use the slidingExpiration attribute in the Forms tag .I am
    > getting the same error message
    > '' Unrecognized attribute 'slidingExpiration' ''
    > Can anybody help me why?
    >
    > Thanks
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    PL, Feb 22, 2005
    #8
  9. enahar

    Ekta Agarwal Guest

    Hi,

    Is there any other way to timing out the asp.net web application when
    not in use for 15 minutes without installing asp.net 1.1

    Thanks



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Ekta Agarwal, Feb 23, 2005
    #9
  10. enahar

    enahar Guest

    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" <> wrote in message
    news:%...
    > 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
    >
    >
    >
    >
    enahar, Mar 16, 2005
    #10
  11. enahar

    Brock Allen Guest

    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" <> wrote in message
    > news:%...
    >
    >> 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
    >>
    Brock Allen, Mar 16, 2005
    #11
  12. enahar

    enahar Guest

    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" <_hate_spam_too> wrote in message
    news:...
    > 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" <> wrote in message
    >> news:%...
    >>
    >>> 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
    >>>

    >
    >
    >
    enahar, Mar 16, 2005
    #12
  13. enahar

    Brock Allen Guest

    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/d...-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" <_hate_spam_too> wrote in message
    > news:...
    >
    >> 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" <> wrote in message
    >>> news:%...
    >>>> 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
    >>>>
    Brock Allen, Mar 16, 2005
    #13
  14. enahar

    Pril Guest

    Try:
    HttpContext.Current.Request.Response.Redirect

    lp, pl

    "enahar" <> wrote in message
    news:...
    > 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" <_hate_spam_too> wrote in message
    > news:...
    > > 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" <> wrote in message
    > >> news:%...
    > >>
    > >>> 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
    > >>>

    > >
    > >
    > >

    >
    >
    Pril, Mar 17, 2005
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andy Green
    Replies:
    3
    Views:
    536
    Alvin Bruney
    Jan 10, 2004
  2. =?Utf-8?B?R1A=?=
    Replies:
    0
    Views:
    371
    =?Utf-8?B?R1A=?=
    Dec 9, 2004
  3. enahar
    Replies:
    8
    Views:
    2,019
    Patrick Olurotimi Ige
    Mar 8, 2005
  4. =?Utf-8?B?RWQgQ2hpdQ==?=

    ASP.Net application session timeouts in 20 minutes

    =?Utf-8?B?RWQgQ2hpdQ==?=, May 4, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    420
    =?Utf-8?B?RWQgQ2hpdQ==?=
    May 4, 2005
  5. =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?=

    Disabled Idle Timeouts, still timing out after 20 minutes

    =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?=, Aug 15, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    14,779
    Steven Cheng[MSFT]
    Aug 22, 2006
Loading...

Share This Page