dotMobimobiThinkingmobiForgemobiReadyDeviceAtlasgoMobi

Cookie Support, and Mobile Devices

daniel.hunt's picture
Posted by daniel.hunt 3 years 34 weeks ago
Bookmark and Share

If you're a regular on the site, you'll have noticed that we have been hard at work creating a new Test Suite that will play nicely with DeviceAtlas.
During its development, I've had to put up with a ridiculous amount of obscure problems, but there's one that continually rears its ugly, ugly head and makes life hell for me. Cookie support. Or lack of it.

Cookies are taken for granted on the non-mobile internet, and I'm not really around long enough to remember it ever being any different (I can hear the gasps from the back row!), so it came as quite a surprise to me to learn that mobile devices don't play ball. Or at least, they try to play ball.

Take, for example, the absolutely wonderful (I had the 6230 for quite some time) Nokia 6230i, and the not-quite-so-fantastic Samsung SGH-ZV10. While testing yet another cookie related issue with the new system (which will hopefully go live in the very near future), I discovered that I was actually sending 2 cookies to the device. The first was an automatic domain level cookie, such as: .testapplication.secretdomain.mobi. The second was one that I was purposefully sending to the device, which was a host level cookie, such as testapplication.secretdomain.mobi. (notice the initial '.' in the domain level one?). My problem was this: the Nokia could login to the site with no problems, but the Samsung couldn't!

The fact that I was sending 2 cookies instead of the 1 that I thought I was sending, was pointed out to me, and I was linked to an extraordinarily helpful blogpost at Mippin, with the ever so convenient title of Cookie Conundrums.
Thanks to their legwork on the problem, and the annoying issue that I was currently dealing with, I discovered that cookie support on mobile devices is not guaranteed! (I know, shock shock, horror horror). And not only is it not guaranteed, but it varies from device to device (the Nokia accepted both cookies, but the Samsung accepted only the host level one). Again I remind you, that this is not something I'm used to dealing with :)

So, armed with this new found knowledge I proceeded to hack my local dev copy of Drupal to pieces in an effort to discover what on earth was going on.
Suffice to say, that Drupal outputs the domain level cookie regardless of the settings you may or may not have in your settings.php file. In order to prevent it from doing this, I had to hack the main bootstrap.inc file to include a switch which, if enabled would output the cookie as normal, and if disabled would output nothing!

Now, thanks to those helpful souls over at Mippin I can get back to doing real work :)

Daniel


Posted by daniel.hunt 3 years 34 weeks ago

daniel.hunt's picture

dotMobi hotshot & diver

Posted by Werner Ruotsalainen (not verified) 3 years ago

Yup, cookie support is pretty much inconsistent in mobile browsers; particularly in ones that aren't a direct port of an already-debugged and conformance tested desktop browser - that is, aren't a direct port of them but, instead, have been developed from scratch (for example, NetFront).

I've run into some very similar problems ranging from summer time problems (see for example my related article at http://forums.thoughtsmedia.com/f322/nasty-dst-related-bug-all-netfront-ppc-versions-71978.html ) with NetFront. With Thunderhawk, there is a problem of permanently storing cookes in the file system.

With Opera Mobile 8.65 (of which I was a closed betatester) I've found a very similar problem to the one you've described (this was fixed upon I've reported this to the Opera folks; however, the problem may still be present in Opera Mini or the desktop Opera; haven't tested this): that is, the problem of the (sub)hosts.

Posted by daniel.hunt 3 years ago

Thanks for the information Werner, it certainly makes for some interesting reading!

Its amazing how beneficial standards are when it comes to things like this. We really do take them for granted, so when a problem occurs that appears to be outside of our normal area of experience, it really is very easy to get stumped in the early stages :)

Daniel Hunt
dotMobi

Daniel Hunt
dotMobi

Posted by darragh 3 years ago

I've noticed a problem recently with Vodafone customers in the UK 'losing' their cookies (and subsequently session) when browsing a mobile site.
The cookies seemed to get 'lost' when the customer's remote IP changed as they browsed the site - possibly due to some sort of load balancing on the WAP gateways.

I don't suppose anyone can shed some light on this?
The workaround I've used is to rewrite the Session ID into the URL.

Posted by daniel.hunt 3 years ago

Darragh,

Does this have anything to do with the OpenWave transcoding proxy between the user and the website's server? If you rerun your tests while using the non-transcoding-proxy gateway, can you replicate this issue? I'd be willing to bet that the issue you're experiencing has to do with a transcoder between the 2 endpoints :)

Daniel Hunt
dotMobi

Daniel Hunt
dotMobi

Posted by sjbhave (not verified) 3 years ago

Hi darragh,

We are experiencing the same problem with O2 UK users that the header Cookie: JSESSIONID=.............. gets lost as the user is browsing the mobile site (and yes when the request IP is changed) This is not happening for all the devices but only for some devices

Do you have idea when the request IP changes? Is it only load or is there something else also?

Posted by CelinT 2 years ago

Yeah those problems with cookies on the mobile phone are just annoying. The good thing is that nowadays the biggest part of phones can actually normally support cookies like your PC does. But the old ones don't support them at all. Thanks for the interesting thoughts mate. I have bookmarked your blog.

Sincerely,

Matt Jutson from mobile application development

Posted by daniel.hunt 2 years ago

Glad you found it interesting Matt. I've been pretty inconsistent with my blog postings though - I must do something about that soon :)

Daniel Hunt
dotMobi

Posted by stevejonathan10 1 year ago

Well said Daniel.

This is the most common obstacle I've found earlier while developing mobile based web application development but I'm little bit dis-agree with Matt at the line which said by him But the old ones don't support them at all. We can upgrade software in old phones so that old phones can also support cookies.

Posted by imarion 34 weeks ago

Cookies are mostly supported, but third party cookies of the kind used in advertising are not universally supported.

My understanding from research a couple of years back on first-party cookies:

iOS and Android work fine
Blackberry depends on the user's settings, so is not very reliable
Windows Mobile had a limit of something like 20 cookies, and then additional ones pushed out the older ones from memory
* Feature phones generally didn't support cookies

For third-party cookies, the above is true, with the notable additional limitation that iOS devices default to blocking third-party cookies. So unless a user changes the default (unlikely), these cookies will not work on iPhones, iPads, etc.

Posted by Emelie 31 weeks ago

It's true that some operators disable or block cookies using the gateway and that is certainly a BAD practice that they should learn to avoid.

It is also true that US operators are rather on the edge of standards in many cases and don't comply with the requirements of OMA and GSM because either they don't care or simply because they are not using a GSM network.

While I can't say that you are wrong, I still think that Cookies are a good solution. I think that in most markets, for devices that support XHTML or WAP 2, Cookies are supposed to work and developers can create simple "honeypots" to check the support and then decide. This is also the reason why I showed the example of URL
torrents decoration.
A good honeypot might be to send a Cookie and also create links with URL decoration, in subsequent hits you can match the Cookie with the parameter you passed and decide what to do.

If you don't like what operators do with gateways you might suggest to your users to configure their mobile device to use an "internet APN" instead of the "WAP APN", when possible. This would be a good way to let operators understand that keeping things closed is not what users want.

Torrent site

Posted by jonathan200 21 weeks ago

A good honeypot might be to send a Cookie and also create links with URL decoration, in subsequent hits you can match the Cookie with the parameter you passed and decide what to do.

Vinagre De Manzana Para Bajar De peso

dietas para bajar de peso en una semana

Posted by jonathan200 20 weeks ago

A good honeypot might be to send a Cookie and also create links with URL decoration, in subsequent hits you can match the Cookie with the parameter you passed and decide what to do.A good honeypot might be to send a Cookie and also create links with URL decoration, in subsequent hits you can match the Cookie with the parameter you passed and decide what to do.

Dating Tips For Men

Posted by molly12 20 weeks ago

This is the most common obstacle I've found earlier while developing mobile based web application development but I'm little bit dis-agree with Matt at the line which said by him But the old ones don't support them at all. We can upgrade software to reverse phone lookup so that old phones can also support cookies.

Posted by jauhis 17 weeks ago

interesting article, there are sometimes problems with cookies.
outback steakhouse coupons

Posted by sonydhiman 13 weeks ago

Cookies problem on the mobile phone are just annoying...
scrabble word finder

Posted by DS karte 13 weeks ago

I personally did not encounter any cookie issues on my own cell phone, however it needs more test for cell phone tracker apps and cell phone lookup services.

Posted by jackhopes 9 weeks ago

Thanks for the interesting thoughts mate.Lawyer

Posted by holdarmy 8 weeks ago

good content, keep posting articles like this one
how to lose weight fast

Posted by danielherzog 7 weeks ago

I'm using the iphone and the most recent update killed my cookies.

cell phone directory

Posted by john7334 7 weeks ago

I honestly never thought of cookies being an issue on cell phones until reading this article. Interesting. Reverse Phone Lookup

Posted by lookup 3 weeks ago

The Cookie Monster doesn't care about privacy concerns. See this cell phone lookup for example.

Posted by dysonwop 2 weeks ago

Hi! Thanks for sharing this, It is a good help for other people like me. Keep up with your good work, thanks! A good honeypot might be to send a Cookie and also create links with URL decoration, in subsequent hits you can match the Cookie with the parameter you passed and decide what to do. cash advance loans

Posted by ronaldf 2 weeks ago

I agree with you and believe it is reliable advice that cookies are recognized in current mobile web browsers. Definitely all mobile phones and latest feature devices will certainly support cookies. phone number lookup

Posted by joseph7941 2 weeks ago

How that can be effective? If I clear cookie is it possible to restore? scrabble cheat

Posted by octavus84 2 weeks ago

It' s true cookies are very annoying, not only on the mobile phone, but also on the pc. The good part is that here you have the option of deleting cookies easy. Cheers. Online math tutor