Javascript Cookie删除 [英] Javascript cookie deletion

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

问题描述

我已经使用名为jsdetect的javascript创建了cookie,并设置了有效期(天).

当我使用C#代码Request.cookies["jsdetect"].expires检查Cookie的到期日期时,始终显示01/01/0001

如何使用在javascript中创建的c#清除cookie.
请执行需要的操作.

I have created cookie using javascript named jsdetect and set the expiry in days.

When I check the cookie expiry date using c# code, Request.cookies["jsdetect"].expires ,it is showing 01/01/0001 always

How can I clear the cookie using c# which was created in javascript.
Please do the needful.

推荐答案

这里是一种实现方法:

Here''s a way to do it:

HttpContext.Current.Response.Cookies.Remove("jsdetect");


已将此

这篇关于Javascript Cookie删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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