The answer given by Alexsandar is just one solution to this problem.
This link clearly explains what is the main cause of this problem and possible solutions: http://blogs.msdn.com/b/brianhartman/archive/2009/02/15/did-your-session-really-expire.aspx
In the case of Brian, as he described the problem, if he had only one IIS server, using a session object in his code could solve the problem, because in this case the SessionID that is transmitted in the request from the browser to the server will be mapped to the corresponding sessionID on the server and, therefore, a message about the expiration of the session does not appear.
The mode setting can only work in the case of a server cluster where Brian had several IIS servers processing the same request. In this case, it will help to retrieve the session object from the session store from process mode, regardless of how it got into the server.
So, based on this observation, I would conclude that the Brian problem is not related to cookies, but to a cluster of servers. The information provided by Brian in his question and subsequent decision misled me and therefore this clarification. Hope this helps anyone looking for a similar issue.
Thanks, Vipul
user398039
source share