none
SharePoint Server ASP.NET Session State Service issue RRS feed

  • Question

  • Hi,

    We have configured “SharePoint Session state service” in SharePoint 2013 Farm and hosted the application [SSOM packages]. Here the issue, first page we are storing the values in session and the same values we are trying to retrieve in second page (load), but we could see that session values NULL in second page. But we can see the session objects in SQL table ([dbo].[ASPStateTempSessions]). [Note: The same code package running without issue in another SharePoint 2013 Farm].

    If anyone face the similar issue/ configured session state service in your experience. Please share your thoughts, it’s more helpful us to resolve this issue.

    Notes:

    1. Session value get stored in SQL without issue.
    2. Session expired time we configured 60 mins.
    3. Compared session state web config entry with working environment.

    Please find the code snippet below,

    Scenario:

    1. First page,  we are storing the values in session object.

    Code Snippet:

    SiteSession.SessionObjects.Add(“key”,”value”)

    1. Redirect to second page.

    Code Snippet:

    SPUtility.Redirect("/Pages/Page2.aspx", SPRedirectFlags.Default, HttpContext.Current);

    1. Second page, we are retrieving the values in page load.[always we are retrieving count zero]

    Code Snippet:

    SiteSession.SessionObjects.Keys.Count

    Regards,

    Sudheer


    Thanks & Regards, Sudheer

    Wednesday, July 3, 2019 9:15 AM

All replies

  • Hi Sudheer,

    Please make sure the "ASP.NET State Service" service is running.

    If you want to use the session between the SharePoint Pages, we can also use JavaScript localStorage and sessionStorage properties of the Window to achieve it. The localStorage and sessionStorage properties allow to save key/value pairs in a web browser.

    https://www.w3schools.com/jsref/prop_win_sessionstorage.asp

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, July 4, 2019 2:39 AM
    Moderator
  • Hi

    Please refer below link.

    https://nikpatel.net/2012/02/12/enable-asp-net-session-state-on-sharepoint-2010-application/

    Not sure whether you need to modify web config in SharePoint 2013.


    Justin Liu Office Apps & Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.

    Thursday, July 4, 2019 2:43 AM
  • Hi,

    Would you please provide us with an update on the status of your issue?

    Best Regards,
    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, July 9, 2019 8:10 AM
    Moderator
  • Hi Sudheer,

    Any update?

    Did you solve this issue?

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, July 16, 2019 3:07 AM
    Moderator