在Safari浏览器中保存cookie

编程入门 行业动态 更新时间:2024-10-25 06:29:57
本文介绍了在Safari浏览器中保存cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好 我有一个Web项目,它的第一页是登录页,在用户登录后,我将用户名保存在cookie中. 当我在Safari浏览器中对其进行测试时,我发现Cookie一直都是null. 因此,如果Safari不支持保存Cookie或存在解决方案? 任何帮助... 感谢

hi all i have a web project , the first page of it is login page , which after user login , i save user name in a cookie . when i tested it in safari browser, i found the cookie is null all time. So, if safari doesn''t support saving cookie or there is a solution ?? Any Help... Thanks

推荐答案

,您只是在编写Cookie,并且无法控制站点读取/显示要放入URLDecode的值,您还可以执行以下操作: you are just writing the cookie and do not have control over the site reading/displaying the value to put in the URLDecode you can also do something like this: ckCookie.Value = (Server.HtmlEncode( strSpecialCharacters )).Replace(";","");

这将确保在cookie中设置完整的字符串,即使不使用; Safari,Chrome,Firefox和IE仍将识别html代码.并且读取时不需要解码. 有关Cookie规范的详细答案,请参见: stackoverflow/questions/1969232/allowed-characters-in-cookies/1969339#1969339 [ ^ ]

This will ensure the full string is set in the cookie and Safari, Chrome, Firefox and IE will still recognize the html codes even without the ; and does not require decoding when read. For a longer answer on cookie specs see: stackoverflow/questions/1969232/allowed-characters-in-cookies/1969339#1969339[^]

更多推荐

在Safari浏览器中保存cookie

本文发布于:2023-11-01 20:31:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550340.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:器中   Safari   cookie

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!