Reputation: 111
I have to set the value of the LoginId textbox from the value in the cookie 'UserLoginId' then once I assign it to the textbox I have to set the value of the cookie to blank(or ""). I am not getting how to reset the value to " ".
<script type="text/javascript">
var jcookie = '@HttpContext.Current.Request.Cookies["UserLoginId"].Value';
$("#LogInId").val(jcookie);
// What to write here to set the value of "UserLoginId"=""?
</script>
Please help me with this..
Upvotes: 0
Views: 262
Reputation: 1583
If you want to remove it, you should change expiration date:
document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
Upvotes: 1
Reputation: 111
In the place of //What to writ here..
document.cookie = "userLoginId="+escape("");
Upvotes: 0