Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone bookmarklet cookie persistence

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.

like image 701
Larry Davis Avatar asked Mar 23 '10 21:03

Larry Davis


People also ask

How do you change browser cookies on iPhone?

SAFARI for iOS (iPhone and iPad)Step 1: Go to Settings, then scroll down and select “Safari”. Step 2: Scroll down to “Privacy & Security”. Step 3: Verify “Block All Cookies” is ticked (green/white), click to allow cookies. Step 4: Clear the browser cache and reopen the browser.

Can you edit cookies on iPhone?

To manage cookies on Safari, go to Safari > Preferences > Privacy, and then click the "Manage Website Data…" button. This displays a list of all websites that have stored cookies on your computer that can be used to track your browsing.

How do you edit cookies on iPad?

Go to Settings, then scroll down and check Safari. Scroll down until you find Privacy & Security. Under the tab Block All Cookies, do not select it (leave it white). Restart Safari.


1 Answers

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.

like image 105
Larry Davis Avatar answered Sep 19 '22 15:09

Larry Davis