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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting a cookie...

Status
Not open for further replies.

halukorhan1

IS-IT--Management
Oct 15, 2003
19
TR
Hi,

I could not manage to delete the cookies on the client when the transaction is over.

The codes given below did not work to delete the cookie.

Response.cookies("sepet")("SID") = ""
Response.Cookies("sepet").Expires = Date() - 15

Even I had tried to change the SID value (assign a new value) in the cookie with the codes given below, but it did not work:
<%
if cint(day(now)) < 10 then
dd = "0" + cstr(day(now))
else
dd = cstr(day(now))
end if

if Cint(month(now)) < 10 then
mm = "0" + cstr(month(now))
else
mm = cstr(month(now))
end if

yyyy = cstr(year(now))

if Cint(hour(time)) < 10 then
hh = "0" + cstr(hour(time))
else
hh = cstr(hour(time))
end if

if cint(minute(time)) < 10 then
min = "0" + cstr(minute(time))
else
min = cstr(minute(time))
end if

'Response.Cookies("sepet").Expires = Now()
'Response.cookies("sepet").Expires = Date() + 14
Response.cookies("sepet")("SID") = dd & mm & yyyy & hh & min & cstr(session.SessionID)

session.Contents.RemoveAll()
%>

Do you have any idea how can I delete the cookie on the client PC?

Any help is appreciated.

Regards!

Haluk
 
ermm! did you miss the you don't bit ??

the only thing you can do is set the expiry and the browser will clear the cookie on the next occasion that a new cookie has to be added and the maximum number of cookies would be exceeded (browser dependant) .

ASP has no means of accessing the client machines drive. Any client side script operation to delete a cookie would very likely be blocked as suspicious activity.

let's see:
Javscript:
you would have to redirect to a page that had a javascript to search the client hard drive for a file that you don't actually know the name of (only part of it) or the location (depends on the browser) Then delete it. Hmm I can see all the unsafe script warnings and alerts happening as I type this.

lets not even bother looking at Client side vbScript or WSH.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top