Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to "Empty" a cookie??

Status
Not open for further replies.

onn99

IS-IT--Management
Dec 10, 2000
24
0
0
AU
Hi,

I am currently having a member login page where a member logs in and my code creates a cookie with expire = 1 day.

Now when the user clicks logout, I have the problem that the cookie doesn't get destroyed, I was hoping there to be a code that can either delete the cookie or just empty the contents of a the cookie.

Now I know I can use creating a cookie with no expiry date so that it will delete it after the browser is closed, but for some reason my IIS or browser doesn't do that and never writes the cookie, so i am force to make an expiry date for it so that it will create a cookie on file.

Help will be most greatful!!

Cheers
 
do not set the expiration date to 1 day. set it to -1 and then the cookie will be distroyed on session end

_________________________________________________________
[sub]$str = "sleep is good for you. sleep gives you the energy you need to function";
$Nstr = ereg_replace("sleep","coffee",$str); echo $Nstr;[/sub]
onpnt2.gif
[sup] [/sub]
 
actually, just don't set the expires and it will perform the same expiration.

_________________________________________________________
[sub]$str = "sleep is good for you. sleep gives you the energy you need to function";
$Nstr = ereg_replace("sleep","coffee",$str); echo $Nstr;[/sub]
onpnt2.gif
[sup] [/sub]
 
I tried that, just doesn't seem to work, both expire = -1 or empty doesn't seem to work.

What's really gotten me is that the login used to work when I had MS Interdev as the development platform, but now that we switched to MS VB.NET, it doesn't work anymore, I am not sure if this have anything to do with it or I am just grabbing at straws.

I you can think of anything else let me know, otherwise, thatk you all your help anyway, this is a great forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top