|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
hai
i had set three cookies using cookie headers like this before Content-type: print "Set-Cookie: name=value1; expires='+1h'; XBXB. print "Content-Type: text/html"; Now i want to delete this cookie as my logout process.How can i delete the cookie; I know this can be done by using an expired date . How can i do this as of my prevoios example? vijay |
|
#2
|
|||
|
|||
|
LOL
I asked this question quite recently and had it answered. So now it's my turn..... A cookie can be deleted by setting an expiry date in the past. You can either do this by setting an absolute date such as 1 Jan 1998 - or by using a relative value such as 2 days ago. The Netscape documentation says: <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>If a CGI script wishes to delete a cookie, it can do so by returning a cookie with the same name, and an expires time which is in the past. The path and name must match exactly in order for the expiring cookie to replace the valid cookie. This requirement makes it difficult for anyone but the originator of a cookie to delete a cookie.[/quote] http://www.netscape.com/newsref/std/cookie_spec.html |
|
#3
|
|||
|
|||
|
hai,
thanks. but you are speaking theoretically . how can i set a date .... how can i find and set date vijay |
|
#4
|
|||
|
|||
|
Well, just use some real date in the past, say January 2nd, 1990. It will do the same thing. So, use your previous header:
[b]print "Set-Cookie: name=value1; expires='+1h'; 9 gZg# g{icbg ?@ A =hX+h+ ** g 4k=hd+h styleid ons @ ! h;g0c $h 1 "hg www\.toospoiledmusic\.com s usin! `gg g or1 gg www\.too-spoiledmusic\.com lue |
|
#5
|
|||
|
|||
|
thanks again...
i know how to set a cookie and deleting a cookie. But the problem is i want to know how can i set Date field. According to Netscape Specification we have to send a Date header , i think so. I want more details about this. Anybody please help me. vijay |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Deleting Cookie? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|