PDA

View Full Version : Deleting Obsolete Cookies - Necessary?


peterinwa
08-03-2003, 01:00 AM
I am presently writing 20 cookies for my users, and I understand that that's the maximum number allowed. I need another, so I'm going to combine some of the existing ones to "make room."

Let's say that I combine 5 of the existing cookies into 1, a new cookie called Combo. Then I create the other new cookie I need, called NewCookie.

I would now technically have 22 cookies, although 5 of them are obsolete.

My cookies are coded for a lifetime of 1 year.

My question is... before I create the two new cookies should I delete the 5 obsolete cookies by re-creating them with a life of 1 second?

Thanks, Peter

brothercake
08-03-2003, 01:52 AM
Yes I think so - it's just tidier to clean up cookies if they're not being used. You can delete cookies by setting them with an expiry date in the past.

Remember that you can only store 4K of data, spread over how ever many cookies you're using.

peterinwa
08-03-2003, 03:57 AM
Thanks, and I misunderstood about the 4k. I thought it was per cookie. Glad to learn that.