Johan S
Johan S

Reputation: 3591

Angular reuse session after refresh/browser closed

How do you work with Angular.js to reuse a session at a webserver (rails) after browser refresh/restart? I'm using RestAngular but I don't know how to store the session? The angular.js app is in my Rails app as a View (with the assets of course) and I have csrf protection fixed.

I want it to work like a regular webpage, where you don't have to log in each time.

Upvotes: 1

Views: 674

Answers (1)

kds
kds

Reputation: 28665

I believe you need to reuse the session objects which is already available in the webserver.

What I would suggest is that, You could use the browser cookie to retrieve the session objects or else you could store a key in the browser DB which you can send to the server via RestAngular and check whether the session is already available. If the session is already there then you can send the relevant data through RestAngular to the browser.

Hope this might help.

Upvotes: 1

Related Questions