简体   繁体   English

如何在不使用数据库和cookie的情况下保存类似cookie的数据?

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

I am not sure whether this is exclusive to wordpress or not. 我不确定这是否仅适用于wordpress。 I am trying to overwrite some user data that appears to be stored in a cookie. 我试图覆盖一些似乎存储在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. 对于来宾来说,它只是一个cookie,但对于注册用户,它也存储在其他位置,即使我删除它或设置一个新的cookie,它也比cookie具有更高的优先级。 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? 有没有一种方法可以保存在页面之间保留的数据,并且该数据比cookie优先且不使用数据库?

You may use local storage get data from server and save it in local storage. 您可以使用local storageserver获取数据并将其保存在本地存储中。 the data will be available between pages. 数据将在页面之间可用。 check this out http://www.w3schools.com/html/html5_webstorage.asp 看看这个http://www.w3schools.com/html/html5_webstorage.asp

hope it helps :) 希望能帮助到你 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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