简体   繁体   中英

How to save cookie-like data without using the database and cookies?

I am not sure whether this is exclusive to wordpress or not. I am trying to overwrite some user data that appears to be stored in a cookie. For guests it's only a cookie, but for registered users it's also stored somewhere else and it takes priority over the cookie, even if I delete it or set a new one. It does change when I edit it from the place it's supposed to be edited, but I exported the entire database before and after doing so and there is no change. Is there a way to save data that persists between pages and takes priority over cookies and doesn't use the database?

You may use local storage get data from server and save it in local storage. the data will be available between pages. check this out http://www.w3schools.com/html/html5_webstorage.asp

hope it helps :)

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