Cookie Help? Expire Just a Part of a Cookie?

Results 1 to 2 of 2

Thread: Cookie Help? Expire Just a Part of a Cookie?

  1. #1
    Kevin Guest

    Default Cookie Help? Expire Just a Part of a Cookie?

    I am new to cookies, and am working on a site that there are several "cookied" pages, one of them is a on-line form, where some info is writen to a cookie and set not to expire for 365 days, now the other part is a Question of the day, that has a cookie that needs to expire at the end of the day.<BR>They both work fine except, if you fill out the form, the cookie gets added to the question of the day&#039s cookie and then the cookie dosent expire for 365 days, so you cant answer the question of the day tomorrow..<BR>Does this make any sence?<BR>Is there a way to force multiple cookies, or expire just part of a cookie using ASP?<BR><BR>Any Help would be greatly appreciated<BR><BR>Kevin

  2. #2
    Join Date
    Dec 1969

    Default RE: Cookie Help? Expire Just a Part of a Cookie?

    Yes you can expire the whole cookie. I am doing this on my web page. I can only say for you to check the way in which you set the cookie. I guve mine different names. See below;<BR><BR>To Set:<BR>Response.Cookies("cookieName1")("cookieKey 1") = "Hi"<BR>Response.Cookies("cookieName1").Domain = cookieDomain<BR>Response.Cookies("cookieName1").Ex pires = date() + 365<BR><BR>Response.Cookies("cookieName2")("cookie Key2") = "Hello"<BR>Response.Cookies("cookieName2").Dom ain = cookieDomain<BR>Response.Cookies("cookieName2").Ex pires = date() + 1<BR><BR>To Expire:<BR>Response.Cookies("cookieName2").Expires = date()-1<BR>Response.Cookies("cookieName2").Domain = cookieDomain<BR><BR>I hope that this helps. As far as I know, you don&#039t have to use the cookiekey, but I usually do just to make the items in the cookie more accesible.<BR><BR>--Eric

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts