简体   繁体   中英

Angular app not working when web browser refreshed

I have an angularJS app, It is working well till I refresh my web browser.

In my application, there is a JSON object that I get based on my login. It got a secession ID and a set of arrays in it. Once I refresh my web page, the JSON object become empty and error occurs where ever the JSON is related to. I get this JSON at the time of login.

What could be the issue? If you need, I can give more explanation.

Refreshing the webpage means resetting all JSON objects. You need cookies to save information even after they leave the page. Also if you detect that someone isn't logged in you should redirect them to the log in page.

Read up on cookies here: http://www.w3schools.com/js/js_cookies.asp http://docs.angularjs.org/api/ngCookies/service/ $cookies

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM