.net - ASP.NET MVC 5 and Session -


is there .net 4.5+ asp.net mvc 5 way of initializing session variable when user makes request first time application?

is there wrong doing this?

if (session["key"] == null)    session["key"] = value; 

that seems accomplish you're looking for.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -