Click here to Skip to main content
11,478,174 members (68,916 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Javascript
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.
Posted 8-Nov-10 21:19pm
Edited 8-Nov-10 23:50pm
Dalek Dave433.2K
v2
Comments
Dalek Dave at 9-Nov-10 4:50am
   
Edited for Readability.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Here's a way to do it:

HttpContext.Current.Response.Cookies.Remove("jsdetect");
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 229
1 F-ES Sitecore 170
2 Sascha Lefèvre 160
3 Frankie-C 120
4 OriginalGriff 105
0 Sergey Alexandrovich Kryukov 7,675
1 OriginalGriff 7,321
2 Sascha Lefèvre 3,034
3 Maciej Los 2,491
4 Richard Deeming 2,325


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 9 Nov 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100