Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone web app, not storing cookie

I am working on a web app for the iOS. When the app is opened, it check's to see if the user has a cookie with the users email stored in it, then either lets the user proceed to the homepage, or redirects the user to the authentication page.

This works perfectly when using safari. The problem I am experiencing occurs only when the app is stored on the home screen. It seems like the home-screen web app deletes the cookie right when the user exits the application.

Any advice on forcing the app to store that cookie would greatly appreciated.

Thanks, Peter

like image 841
Peter Avatar asked Aug 10 '10 19:08

Peter


1 Answers

The reason its not sticking around is because the timeout parameter is not set.. if it is blank or 0, then the cookie will be deleted when the uiwebview is closed..

so you can do as the other poster suggested..

setcookie("TestCookie", $value, time()+3600, "/");

,but the reason that works is because of the timeout value being set

like image 192
user353877 Avatar answered Oct 08 '22 01:10

user353877