Cookies / Session variable problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Cookies / Session variable problem

Post by Unipus »

I've built a shopping cart app that stores shopping cart items in an associative array session variable. Works like a charm... UNLESS the user has turned off "automatic cookie handling" in IE and not checked "always allow session cookies." On the one hand, this is a serious problem that break the site... on the other hand, it affects only a very small percentage of users and only those on IE (turning off cookies in Mozilla does not have this nasty effect). Of course, stupid IE with its stupid overwhelming market share compounds the matter... but you see my point.

So... thoughts? Statistics? Solutions?
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Yep. All right, then.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Unless you wish to have the session id in the URL, which I personally do not like, then you can test to see whether you are able to set a session cookie. If you can't, display a message saying 'You need to enable cookies to use this site', and link to a privacy statement which tells the punters that it is just a session cookie and will only last x amount of time and they really won't be able to shop on the site without it. Giving an easy-to-understand explanation of a session cookie to help educate the paranoid, ie. you can't use it to track their movements to another site, you don't store their name, credit card details etc in it, may help.

Mac
Post Reply