Forum Moderators: coopster

Message Too Old, No Replies

kill order cookies

         

indiguy

5:39 am on Oct 28, 2009 (gmt 0)

10+ Year Member



is there a way to kill a js cookie with out using session?

as when i close browser and reopen it, the last order exists... or do i need to introduce sessions, and code to kill when session is expired?

Im using joomla cms.

most my code is php.

rocknbil

4:45 pm on Oct 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Using Javascript to set/get cookies for orders on an ecommerce site is a bad idea on many levels, you should be setting the cookies using your server side programming.

But in either case, there are two types of cookies: session cookies and persistent cookies. Don't confuse this with PHP sessions, they are two different things.

Session cookies are set without the "expires" parameter, so they die when the browser closes. For this reason it sounds like you are setting a persistent cookie with an expiration date. To kill it, just re-set the same-named cookie with a past date, which makes it expire.

indiguy

5:08 am on Oct 29, 2009 (gmt 0)

10+ Year Member



thanks for the advice. But this is a cashless ecom site, so im not worrying too much about that. There still remains real world contact between the clients and biz before any order is finalised.

rocknbil

5:59 pm on Oct 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I misworded the sentence - what I mean is, anything that receives orders of any kind. The problem is you are making the process Javascript dependent. If it's disabled or broken in your visitor's browsers, it won't work. :-)