R
R
Ramil Z.2015-11-24 13:29:34
Angular
Ramil Z., 2015-11-24 13:29:34

How to implement session persistence after browser close in Angular?

Hello!
There is a server module implemented in Yii 2. And there is a client module in Angular.
Authorization happens through OAuth (HttpBearer) . The client sends a username and password, receives a token and stores it in $window.sessionStorage for further use in requests.
After closing the browser (or even bookmarking the browser), you have to log in again.
The default non-angular implementation uses cookies to store the session.
Question: how to implement this checkbox "Remember me" for a day on ANGULAR JS?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kostya Gorozhanov, 2015-11-24
@proteye

Try $window.localStorage or angular-cookies.js

R
Ramil Z., 2015-11-24
@proteye

Thank you. Just looked towards localStorage.
But as I understand it, in angular js you can also work with cookies, as in a regular web application?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question