Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

ASP.net Session expiring before Authentication

  • 30-04-2010 11:18AM
    #1
    Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭


    Hi,

    I'm working on an MVC 2 application which stores a few objects in Session when the user logs in.

    My problem is that even though I've set the session to expire at the same time as the forms authentication session, the session is expiring before that. So the result is that the session is null when it shouldn't be.

    Here's two of the relevant settings from my web.config:
    <authentication mode="Forms">
    			<forms loginUrl="~/Account/LogOn" timeout="30"/>
    		</authentication>
        <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="30"/>
    

    Anyone have any ideas how to get these to expire at the same time?

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,494 ✭✭✭kayos


    John_Mc wrote: »
    Hi,
    <authentication mode="Forms">
    			<forms loginUrl="~/Account/LogOn" timeout="30"/>
    		</authentication>
        <sessionState mode="InProc" cookieless="false" timeout="30"/>
    

    Try that instead. You had configured some strange Hybrid of InProc, SQLServer and StateServer modes.

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


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    kayos wrote: »
    Try that instead. You had configured some strange Hybrid of InProc, SQLServer and StateServer modes.

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

    Hi,

    Many thanks for your reply. I tried that but the problem is still occurring. Nevertheless, still a good idea to get rid of redundant settings :)

    Any other suggestions?


  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    whats the IIS timeout on your web project?


Advertisement