如果用户在浏览您的网站时删除了Cookie,该怎么办? [英] What if user deletes cookies while navigating your website?

查看:127
本文介绍了如果用户在浏览您的网站时删除了Cookie,该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设有一个页面询问用户他/她的姓名,年龄等,并将其保存到cookie中。现在,用户正在您的网站上导航,并在他/她之间删除所有Cookie,然后导航到使用这些Cookie的其他页面。据我说,下一页会得到空白值吗?如何处理这个缺点? 我不希望用户再次填写这些详细信息。

Suppose there is page which asks user for his/her name,age etc. and save it into cookies. Now user is navigating on your website and in between he/she deleted all the cookies and then navigates to the other page which uses these cookies. According to me the next page will get blank values right? How to handle this drawback? I don't want user to fill those details again.

推荐答案

如果您不希望用户再次填写详细信息然后告诉用户停止删除cookie。如果他们删除了cookie,他们不得不再次输入信息,他们不应该感到惊讶。



然而,要真正执着,不要使用cookies 。将信息存储在数据库中。
If you don't want the users to fill in the details again then tell your users to stop deleting cookies. They shouldn't be surprised that they have to enter the information again if they deleted the cookies.

However, to be truly persistent don't use the cookies at all. Store the information in the database.


您可以将其保存到数据库,然后将数据加载到会话变量中。
You can save it to a database and them load the data into a session variable.


这篇关于如果用户在浏览您的网站时删除了Cookie,该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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