views:

368

answers:

1

I have an iphone (jqtouch based) web app that uses cookies for authentication. The use flow is as follows :

  • user goes to the mobile landing page and is instructed to save the page as a bookmarklet on their home page.

  • they launch the bookmarklet to go to a login page to login and get a cookie.

  • the cookie works and they can navigate throughout the web site.

  • However this session cookie is not persistent. If they leave safari and then restart using the saved bookmarklet, the cookies set during their previous session are gone.

  • Just using safari (ie: launch safari directly rather than through the bookmarklet) to navigate the pages works fine (ie: start safari, go to url, do login, restart safari, go back to url).

  • I find that that the cookies that were active when the bookmarklet was created are persistent but any cookies set during the session when safari is accessed through the bookmarklet are not persistent.

  • I'm wondering if this is a safari/iphone issue and/or if there is any way around this. Many thanks for any insight you can provide.

A: 

K, for anyone encountering the same problem, i found a work around by making use of html5's localstorage. I just needed to use javascript to set the storage based on cookie values as the cookies were being set and to set the cookies from the storage values when the first page was loaded.

Larry Davis