locked
Related to session RRS feed

  • Question

  • User-1143358057 posted

    hi, i want to know how expire the session after certain period of time which has been created once the customer logged in to the page


    Wednesday, February 2, 2011 9:48 AM

Answers

  • User1763913335 posted

    i want to know how expire the session after certain period of time



    Hi,


      ASP.Net provides a very effective StateManagement.  Session State is actually created for millions of users.

    Let's check the case of one user:


    1. When User log in to a site through a browser, a session for that user begins.

    2. Every session is identified by a Unique Session ID , which is given by the Server.

    3. Every Interaction the user make through the web browser is identified through this session ID.

    4. Session Expires while following :

        1)   When The User logs out, the session expires.  We have coded like

                Session.Abandon();

       2)   When the user closes the browser, the Session expires.

       3)   When the user doesn't make a response in 20 minutes after he logged in, the session automatically times out. This is because the default session timeout period is 20 minutes.

     4)  When User accesses the same site through different browsers at the same time, session can cause some problem. It depends upon the browsers' behaviour.


       These are how a session expires.


       Hope it helped you,


        Mark as answer if it helped you.


      Thanks & regards,

         Durga


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 2, 2011 11:01 AM
  • User236141260 posted

    Web.config file contains entry of sesstion state which define a property of timeout, this property contains munber of minuts. Suppose if you have set this property to 30. If user open some page and didnt perform any action within 30 minuts then this server expires session of this user.

    <sessionState timeout="30"/>

    This entry will set session time for your website in IIS.

    For session state please see following link.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 2, 2011 11:12 AM
  • User712082397 posted

    You can configure timeout within web.config file like this:

    <sessionState mode="Off|InProc|StateServer|SQLServer"
                  cookieless="true|false"
                  timeout="number of minutes"
                  stateConnectionString="tcpip=server:port"
                  sqlConnectionString="sql connection string"
                  stateNetworkTimeout="number of seconds"/>

    http://msdn.microsoft.com/en-us/library/h6bb9cz9(VS.71).aspx

    Or, you can explicitly call "Session.Abandon" method in your "LogOut" event handler.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 2, 2011 11:28 AM

All replies

  • User1763913335 posted

    i want to know how expire the session after certain period of time



    Hi,


      ASP.Net provides a very effective StateManagement.  Session State is actually created for millions of users.

    Let's check the case of one user:


    1. When User log in to a site through a browser, a session for that user begins.

    2. Every session is identified by a Unique Session ID , which is given by the Server.

    3. Every Interaction the user make through the web browser is identified through this session ID.

    4. Session Expires while following :

        1)   When The User logs out, the session expires.  We have coded like

                Session.Abandon();

       2)   When the user closes the browser, the Session expires.

       3)   When the user doesn't make a response in 20 minutes after he logged in, the session automatically times out. This is because the default session timeout period is 20 minutes.

     4)  When User accesses the same site through different browsers at the same time, session can cause some problem. It depends upon the browsers' behaviour.


       These are how a session expires.


       Hope it helped you,


        Mark as answer if it helped you.


      Thanks & regards,

         Durga


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 2, 2011 11:01 AM
  • User236141260 posted

    Web.config file contains entry of sesstion state which define a property of timeout, this property contains munber of minuts. Suppose if you have set this property to 30. If user open some page and didnt perform any action within 30 minuts then this server expires session of this user.

    <sessionState timeout="30"/>

    This entry will set session time for your website in IIS.

    For session state please see following link.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 2, 2011 11:12 AM
  • User712082397 posted

    You can configure timeout within web.config file like this:

    <sessionState mode="Off|InProc|StateServer|SQLServer"
                  cookieless="true|false"
                  timeout="number of minutes"
                  stateConnectionString="tcpip=server:port"
                  sqlConnectionString="sql connection string"
                  stateNetworkTimeout="number of seconds"/>

    http://msdn.microsoft.com/en-us/library/h6bb9cz9(VS.71).aspx

    Or, you can explicitly call "Session.Abandon" method in your "LogOut" event handler.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 2, 2011 11:28 AM