asp.net web api - Webapi and Sessions -


i trying add sessionstate existing asp.net application. have added

httpcontext.current.setsessionstatebehavior(sessionstatebehavior.required)

to global.asax file each time make call api, new session created.

here how trying view session

        var session = httpcontext.current.session;          if (session != null)         {             if (session["testsession"] == null)             {                 session["testsession"] = "session exists"             }             return "testsession: " + session["testsession"];         }          return ("no session"); 

just wondering if else has encountered problem, using session state sqldatabase store session


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -