Dec 6, 2011

Multiple HTTP Headers: No cookie for you

Hi, all

As you may know, HTTP Cookies are mostly used to track sessions between a client and a server. The flow is pretty simple: you access a server and it returns a piece of information (a cookie), which the client stores, in order to send back in every subsequent request. Based on this cookie, the server identifies the client.

Unfortunately, this session management must be handled by the developer, since HttpConnection does not do that automatically. This is achieved in a very simple way and a few lines of code. If do not know how to do it, please learn now here.

According to the example at Nokia's page, session management using a single cookie is very easy. How about two? It should be easy as well. Instead of only one, now you have to store two and send them back.

In a project that I am currently working on, there are two cookies to manage the session. As I said above, it is very easy, right? It should be. I am porting a code from Nokia S60 5th Edition series to S40 6th Edition. This session management works like a charm, but it fails on S40. Any guess? No? Read the post's title again. The answer is:

Series 40 platform devices up to Series 40 6th Edition and Series 40 5th Edition, Feature Pack 1 Lite, and S60 devices prior to S60 3rd Edition, Feature Pack 1 does not support multiple HTTP header. It means that two cookie cannot be handled, because only one is available. Nice, hah?

Long story short, we had to implement a workaround in our server for S40 version, where only one cookie is used for session management. As a consequence of it, this version accesses a no scalable server, since the second cookie was used for load balancer.

W.O.R.A does not work so well on mobile devices.

See you in the next post...