0

I am trying to create and maintain a Session while user is using an app, Angular side is pretty simple, i just can create a service which are going to contain Session data unless user choose to refresh where by data will be lost. like here: Maintaining Session through Angular.js

Since MVC web api is restfull, session will always be null (unless using some hacks like here: ASP.NET Web API session or something?, which i dont want to). Do i have to create a separate session table in DB and maintain it on user loggin/logout? or what would be the angular way to do it right?

3
  • Hi, I have the same question, what did you go for? So it's not possible to keep a session on server side? Thanks a lot Commented Mar 7, 2014 at 22:33
  • Hi, see my other uestion over here :stackoverflow.com/questions/21930662/… i enden up using caching with a single cookie client side Commented Mar 8, 2014 at 14:46
  • thanks a Lot!! Looks an excellent approach, I will try to implement that and hope I don't get any error :). Appreciate your support. Commented Mar 8, 2014 at 15:03

1 Answer 1

1

Why send the state all the way to the server. Instead you can save it in either window.sessionStorage or window.localStorage if you want things to persist over a browser restart.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.