Session/Cookie problems on some mobile phones

by Stii

nokia-6110nav-00You’re busy developing a mobile site and have a log in section, but for the life of you you simply cannot log in. You dig deeper and find that for some daft reason that the mobile device you’re using (like the Nokia 6110 Navigator) does not store the session cookie, thus your session is lost every time you load a page.

You would probably run into this if your domain name is something like http://afrigator.mobi, without the www. or m. (i.e. without a domain prefix). The issue is that cookies for a specific domain are specified like:

//Cookie domain
$domain = '.afrigator.mobi';

A phone like the Nokia 6110 Navigator (its the phone I use, but there may well be lots more) is looking for the domain prefix (the www. or m.) and fails to store the cookie if none is present like in the case of http://afrigator.mobi

A pain in the butt which you might want to be aware of! The solution? Add a prefix should work. Downloading and installing Opera Mini could also work (although, I’m speculating since I have not tried that, but will soon enough). Anyone know of any other solution?