Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Issue with Cookies not getting deleted even after setting a previous date in expires property

Reply
Thread Tools

Issue with Cookies not getting deleted even after setting a previous date in expires property

 
 
techie
Guest
Posts: n/a
 
      09-16-2003
I am using the following to delete the contents of a cookie

Response.Cookies("maincookie").expires = DateAdd("d",-2,now)
Response.redirect "login.asp"

If i try to alert the value of the cookie in the same page, it shows
the old value. As well as when it is alerted from the login.asp it
shows the old value.
The problem is when i try to update the value of the cookie in the
login page, it does not update the new value.
Only if i close the browser and reopen, the new value gets updated and
even if the old value is originally present in the cookie.
I am specifying the domain and path when creating the cookie. the
expires property is set to date + 1 when creating.

What should be done to delete the contents of the cookie? Should i
specify the domain as well as path when changing the expires property?
Thanks in advance
 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      09-16-2003
I suspect the page/site info is being cached. Try putting the "no cache"
code into your page(s).

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------


"techie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I am using the following to delete the contents of a cookie
>
> Response.Cookies("maincookie").expires = DateAdd("d",-2,now)
> Response.redirect "login.asp"
>
> If i try to alert the value of the cookie in the same page, it shows
> the old value. As well as when it is alerted from the login.asp it
> shows the old value.
> The problem is when i try to update the value of the cookie in the
> login page, it does not update the new value.
> Only if i close the browser and reopen, the new value gets updated and
> even if the old value is originally present in the cookie.
> I am specifying the domain and path when creating the cookie. the
> expires property is set to date + 1 when creating.
>
> What should be done to delete the contents of the cookie? Should i
> specify the domain as well as path when changing the expires property?
> Thanks in advance



 
Reply With Quote
 
 
 
 
techie
Guest
Posts: n/a
 
      09-17-2003
Thanks for your response.
I have the "no cache" code already in the files.
The main problem is that as soon as i update the value of the cookie
and alert it.. its shows updated value.. but in the following pages it
still uses the old value unless i close the browser and re-open.



"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message news:<(E-Mail Removed)>...
> I suspect the page/site info is being cached. Try putting the "no cache"
> code into your page(s).
>
> --
> ----------------------------------------------------------
> Curt Christianson (Software_AT_Darkfalz.Com)
> Owner/Lead Designer, DF-Software
> http://www.Darkfalz.com
> ---------------------------------------------------------
> ..Offering free scripts & code snippits for everyone...
> ---------------------------------------------------------
>
>
> "techie" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > I am using the following to delete the contents of a cookie
> >
> > Response.Cookies("maincookie").expires = DateAdd("d",-2,now)
> > Response.redirect "login.asp"
> >
> > If i try to alert the value of the cookie in the same page, it shows
> > the old value. As well as when it is alerted from the login.asp it
> > shows the old value.
> > The problem is when i try to update the value of the cookie in the
> > login page, it does not update the new value.
> > Only if i close the browser and reopen, the new value gets updated and
> > even if the old value is originally present in the cookie.
> > I am specifying the domain and path when creating the cookie. the
> > expires property is set to date + 1 when creating.
> >
> > What should be done to delete the contents of the cookie? Should i
> > specify the domain as well as path when changing the expires property?
> > Thanks in advance

 
Reply With Quote
 
Curt_C [MVP]
Guest
Posts: n/a
 
      09-17-2003
where is the cookie "read" in? on the other page or ?

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------


"techie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Thanks for your response.
> I have the "no cache" code already in the files.
> The main problem is that as soon as i update the value of the cookie
> and alert it.. its shows updated value.. but in the following pages it
> still uses the old value unless i close the browser and re-open.
>
>
>
> "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message

news:<(E-Mail Removed)>...
> > I suspect the page/site info is being cached. Try putting the "no cache"
> > code into your page(s).
> >
> > --
> > ----------------------------------------------------------
> > Curt Christianson (Software_AT_Darkfalz.Com)
> > Owner/Lead Designer, DF-Software
> > http://www.Darkfalz.com
> > ---------------------------------------------------------
> > ..Offering free scripts & code snippits for everyone...
> > ---------------------------------------------------------
> >
> >
> > "techie" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) om...
> > > I am using the following to delete the contents of a cookie
> > >
> > > Response.Cookies("maincookie").expires = DateAdd("d",-2,now)
> > > Response.redirect "login.asp"
> > >
> > > If i try to alert the value of the cookie in the same page, it shows
> > > the old value. As well as when it is alerted from the login.asp it
> > > shows the old value.
> > > The problem is when i try to update the value of the cookie in the
> > > login page, it does not update the new value.
> > > Only if i close the browser and reopen, the new value gets updated and
> > > even if the old value is originally present in the cookie.
> > > I am specifying the domain and path when creating the cookie. the
> > > expires property is set to date + 1 when creating.
> > >
> > > What should be done to delete the contents of the cookie? Should i
> > > specify the domain as well as path when changing the expires property?
> > > Thanks in advance



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE caching previous property positions for deleted properties Brett Javascript 26 12-22-2009 10:42 PM
Why my working ps/2 mouse freezes and even don't even get recon.after reboot ? demi General Computer Support 0 08-03-2007 05:28 AM
Page Expires - even on Back button? Robert Mark Bram ASP General 1 08-11-2004 01:24 PM
Record not being deleted in dbase, even tho the display on datagrid is deleted.. Chumley the Walrus ASP .Net Web Controls 2 08-10-2004 02:23 PM
maintaining control with cookies (not strictly an ASP or even server side question. But not not either) Stephanie Stowe ASP General 2 04-07-2004 04:23 PM



Advertisments