Wrong Created and Expiry date in ASPStateTempSessions table for SQL Server Session mode RRS feed

  • Question

  • User-1177472553 posted

    Hi .. m using SQL Server session mode.its working fine except for the date's getting displayed in Created and Expiry columns of ASPStateTempSessions table . any spefic reason for this?

    Friday, June 24, 2011 1:27 PM

All replies

  • User-29804325 posted


    .its working fine except for the date's getting displayed in Created and Expiry columns of ASPStateTempSessions table

    Can you please elaborate your issue? Does the Created and Expired cloumn not stored datetime correctly or can not display in page?

    Web.config could be:

       sqlConnectionString=”data source=; integrated security=true”

    You can check these links for configue sql session state.



    And BTW, SqlSessionStateStore use a SQL Server Agent job that periodically calls the stored procedure DeleteExpiredSessions to remove expired sessions. So you do not worry about the session expiration.

    Hope this can help you.

    Tuesday, June 28, 2011 10:43 PM
  • User-1177472553 posted

    i am able to save data in the session object which internally saves into sql server DB .. no issue with saving and retreiving data ..

    my doubt, (will rather call it as a doubt than an issue) is why the date in CreatedDate and ExpiryDate coulmn's in ASPStateTempSessions  are wrong.

    ex: i have stored a string in session : session["abc"]="Siva";  say at 6/29/2011 11:45:00

    now this would sit in the ASPStateTempSessions table, but the createddate and expirydate are showing differently, say 6/15/2011 etc etc ..

    have gone through some forums which said its an internal bug .. is this correct or do i need to change any thing at my code level ..

    Note:Have tested this in my development environment.


    Wednesday, June 29, 2011 1:58 AM
  • User-1636149233 posted

    Just in case someone else stumbles upon this. I hade the same issue, I'm going to guess it's not well tought out by the creators: The procedures that write in the ASPState* tables, and the defaut falues to the fields in those tables are using getutcdate() instead of getdate() for the current dateTime. I guess it doesn't take into account day light saving, it was one hour off for me. Went trough all the procedures and changed it and it worked.

    Thursday, April 16, 2015 5:07 AM
  • User1875871952 posted

    Good observation... if you need further help please feel free to reach us:-


    GDKN - Quality Solutions without the Premium Cost


    Solutions to solve our client’s problems through a durable global infrastructure and powerful methodologies

    With over 20 years of experience in the IT services and staffing industries, unparalleled sourcing methodologies and global capabilities, GDKN is uniquely equipped to provide the right software solutions

    IT Services, Application development, Custom Software, Business process, Automation, Software Development, Software solution, Application Maintenance ,Enterprise application development

    Tuesday, June 9, 2015 5:21 PM