Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.