by thebeebs
18. October 2009 05:35
The session Id is written to a cookie only when Session.SessionId is called, in my current project we don’t use many sessions in the application but they are used by some partial views to pass data around.
Because Session.SessionId is not called before the page is flushed, when the view decides that it needs to save some session information after the page has flushed, it’s too late for the application to write the SessionId to the users cookie collection and so the above error is thrown.
To fix the issue I have ensured that we call Session.SessionID before the page has been flushed by adding the following code into the session start:
This should fix the issue.
2de50f33-a54e-4a8d-bd5d-137ee0f60026|1|5.0
Tags: