Reputation: 763
i want to set session variables from web api controller and access it into App.js method is there any way to access like that ?
i'd already tried using :-
HttpContext.Current.Session
but i'm not able to set and access session variables globally and access it on second page ...
Upvotes: 0
Views: 3483
Reputation: 1589
There is no session mechanisim on web api beacuse it is against restfull idea.
If you need to store data like session you may consider to use
Http Cookies http://www.asp.net/web-api/overview/advanced/http-cookies
Encrypted tokens which has the information you want to store.
Use an MVC application like web api (playing with routes)
Don't store sensitive data and use HTTPS
Upvotes: 1