Saturday, March 29, 2008

How to fix the bug which prevents the iPhone from maintaining cookies/sessions (firmware 1.1.4)

When I started using Safari on my iPhone, I realised something was strange: I couldn't maintain a session on gmail or Facebook for more than a few seconds. I actually only could red 1 message and then the site would ask for my login and password again. I suspected something was wrong with the cookies management, but I didn't find anything in the settings menu to help me.

A Google search helped me to solve the problem. It seems like on some iPhone shipped with firmware 1.1.4 there is an issue with the permissions on some folders, including the one containing the cookies. These folders belong to the root user whereas when you use the iPhone you are actually logged in as a user called mobile.

To fix this, you can just open the terminal on you iPhone (it has to be jailbroken and with the Terminal application installed) and type:

chown -R mobile /var/mobile/


This will fix the permissions and cookies should work properly.

No comments: