检查PHP是否存在HTML5 sessionStorage值(与cookie一样) [英] Check if HTML5 sessionStorage value exists with PHP (like with cookies)

查看:107
本文介绍了检查PHP是否存在HTML5 sessionStorage值(与cookie一样)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用PHP可以检查cookie是否存在。有没有类似的方法来检查HTML5 sessionStorage(webstorage)项是否存在?

With PHP it's possible to check if a cookie exists. Is there a similar way to check if a HTML5 sessionStorage (webstorage) item exists?

推荐答案

如果你的意思是sessionStorage HTML5 web存储(我从你问题中的标签中理解),然后没有。无法从PHP访问此数据。它只能通过JavaScript访问,并通过AJAX传递给PHP。

If you mean by sessionStorage the HTML5 web storage (as I understand from the tags in your question), then no. It is not possible to access this data from PHP. It can only be accessed with JavaScript and passed through to PHP with AJAX.

这篇关于检查PHP是否存在HTML5 sessionStorage值(与cookie一样)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆