I’m pretty basic with .net
But basically I’ve been told that to have session stickiness for my website in the environment it is to be deployed means I have to get session from the cookie ASP.NET_SessionId
But what does this mean/how do I use this?
And where I am using my existing session code e.g. Session.Add("Something", something) do I now need to change this?
This is automated for you
You don’t have to manually read cookies yourself. Asp.net does it for you. So whenever you access
Sessiondictionary your session will already be preserved if it existed from your previous request(s). If there is none (or expired) it will also be automatically created so adding items to it will make it work without a problem.So basically instead of accessing Session identifier from a cookies and do whatever with it (as you won’t be able to access intrinsic session store), just use
Session:and for reading
Are cookies mandatory?
Basically Asp.net supports other means of session ID storage apart from cookies. You can enable cookieless session if you wanted to (a setting in
web.configfile). Session identifier will be added to your URL like:Read more about it here on MSDN.
What’s the default?
By default session identifier is preserved in cookies. That means that you don’t have to change anything in
web.config. But if you’d like to use other means you’d have to set that inweb.config(check the same upper link as before).