如何启用cookie [英] how to enable cookies

查看:88
本文介绍了如何启用cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个网站,我必须在其中保存一些在给定的复选框列表中选择的符号,并在打开页面时(即表单加载事件)在列表框中检索这些符号.现在,我必须使用cookie以使符号已保存和检索
适用于不同的客户端.但是问题是,如果关闭了客户端的浏览器Cookie,
数据将不会保存.所以我想像以前一样打开浏览器cookie并关闭它.这可能吗?c#中的代码是什么?

I am building a website in which I have to save some symbol which are selected in checkboxlist given,and retrieve those in a listbox when the page is opened(i.e form load event).Now I have to use cookies such that the symbols are saved and retrieved
for different client.But the problem is that,if clients'' browser cookie is turned off,
the data will not be saved.So I want to turned on browser cookie and turned off as before programetically.Is this possible?What is the code in c#?

推荐答案

对于关闭了Cookie的客户端,您无能为力.最好的办法是编写代码,以便在未打开Cookie的情况下正常运行(并且可能会在您的网页上发出一条通知,要求它必须打开Cookie才能正常工作).
There''s nothing you can do about the client having cookies turned off. The best you can do is write your code so that it fails gracefully if cookies aren''t turned on (and maybe put a notice on your web page that it requires cookies to be turned on to work as intended).


这篇关于如何启用cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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