[英]Issue Deleting Cookies with Domain specified
當用戶從子域(pm.skor.in)注銷,然后重定向到主域(skor.in)時,我正在設置消息cookie。
進入skor.in時,該cookie將顯示給用戶,感謝他們注銷。
我遇到的問題是cookie永遠不會消失。
這是代碼:
If Request.Cookies("msg") IsNot Nothing AndAlso Request.Cookies("msg").Value.Length > 0 Then
Response.Write("<div class=""notification msginfo"">")
Response.Write("<a class=""close""></a>")
Response.Write("<p>" & Request.Cookies("msg").Value & "</p>")
Response.Write("</div>")
Response.Cookies("msg").Value = String.Empty
Response.Cookies("msg").Domain = ".skor.in"
Response.Cookies("msg").Expires = DateAdd(DateInterval.Year, -1, Date.Now)
End If
如您所見,我將cookie的值設置為空,並使其在昨天到期,但是,每當我導航到skor.in上的另一個頁面時,都會出現該消息,並檢查瀏覽器cookie,它仍然存在。
抱歉。 我是工具
問題是我沒有在注銷時設置域。
不管怎么說,多謝拉
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.