I need to store a date in the session state.
On my development version, I’m using InProc session so of course, I just store the value in the session as a datetime type and it works. When I plan to release the app, I’ll be upgrading initially to SQL server session and then eventually deploy the app in azure and use AppFabric to store the session state.
My question is this: can I keep the session as is or do I need to store the date as a string with ToString() to set and a parse to get the value back?
Thanks.
You can store all primitive .NET types or serializable types in session if you use external data store and any object for InProc session-state mode. So in your case, you don’t have to convert to string, you can just store it as DateTime object.