locked
IIS session state timeout value RRS feed

  • Question

  • Hi,

    Is it possible to get the IIS session state timeout value from the machine the site is hosted on (in C# code)?

    Regards

    • Moved by Neddy Ren Friday, March 2, 2012 5:44 AM (From:Visual C# General)
    Wednesday, February 29, 2012 12:24 PM

Answers

  • IIS session state is just the session state configured for the ASP.NET in question.  You can retrieve the timeout value within ASP.NET by querying the Timeout property of the session.  Note that each application can have a different timeout so you have to query within the context of the application.

    If you are interested in doing this at the server level then you'll have to switch to the IIS metadata API.

    Michael Taylor - 2/29/2012
    http://msmvps.com/blogs/p3net

    • Proposed as answer by tgoyer Wednesday, June 12, 2013 6:47 PM
    • Marked as answer by Just Karl Friday, October 4, 2013 3:57 PM
    Wednesday, February 29, 2012 2:53 PM
  • Hi blabbermouth,

    The questions here should be the ASP.NET issue. You will need to post the questions to the IIS forum for more professional supports. 

    http://forums.iis.net/ 

    Or for the session state, you can also post the questions to the ASP.NET forum:

    http://forums.asp.net/22.aspx/1?State+Management 

    I will help you to move your thread to the off-topic forum. Thank you for understandings.

    Best Regards


    Neddy Ren[MSFT]
    MSDN Community Support | Feedback to us


    • Edited by Neddy Ren Friday, March 2, 2012 5:44 AM
    • Marked as answer by Just Karl Friday, October 4, 2013 3:57 PM
    Friday, March 2, 2012 5:42 AM

All replies

  • IIS session state is just the session state configured for the ASP.NET in question.  You can retrieve the timeout value within ASP.NET by querying the Timeout property of the session.  Note that each application can have a different timeout so you have to query within the context of the application.

    If you are interested in doing this at the server level then you'll have to switch to the IIS metadata API.

    Michael Taylor - 2/29/2012
    http://msmvps.com/blogs/p3net

    • Proposed as answer by tgoyer Wednesday, June 12, 2013 6:47 PM
    • Marked as answer by Just Karl Friday, October 4, 2013 3:57 PM
    Wednesday, February 29, 2012 2:53 PM
  • Hi blabbermouth,

    The questions here should be the ASP.NET issue. You will need to post the questions to the IIS forum for more professional supports. 

    http://forums.iis.net/ 

    Or for the session state, you can also post the questions to the ASP.NET forum:

    http://forums.asp.net/22.aspx/1?State+Management 

    I will help you to move your thread to the off-topic forum. Thank you for understandings.

    Best Regards


    Neddy Ren[MSFT]
    MSDN Community Support | Feedback to us


    • Edited by Neddy Ren Friday, March 2, 2012 5:44 AM
    • Marked as answer by Just Karl Friday, October 4, 2013 3:57 PM
    Friday, March 2, 2012 5:42 AM
  • I disagree with this categorization.  While the question was worded awkwardly, the original poster wanted to know how to retrieve the session time-out in their C# ASP.NET application.
    Wednesday, June 12, 2013 6:47 PM