开发者

How to store session data on the client-side regardless of the server domain?

I would like to store session data for a browser-based control panel of an embedded server. The server can be accessed b开发者_Go百科y its IP, the DNS-provided hostname, and any custom hostnames the user setup.

How would one set a, let's say, a session ID cookie that would be valid on all the accessible hostnames?


window.name can hold several megabytes of string data and is server agnostic. The only issue is that it is unprotected, so other sites can read/write to window.name as well.

What you can do is prepend your string data with an identifier; if the identifier is not there, retrieve the data from the server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜