PDA

View Full Version : Sencha/HTML5 and PHP sessions



Severance
11 Nov 2010, 3:04 AM
Hello,

I have a web app built with sencha touch.

It works perfectly when I am on safari on the iphone and when I am on chrome on my computer.

Then in safari I click on the button "Add to home page" to have a beautiful icon on my iphone home page.

But when I launch the web app from my home page (so not in safari), the web app doesn't store PHP sessions ! So when I switch to another app, I have to log me again when I return on the web app !!

Could you help me ?

evant
11 Nov 2010, 9:33 AM
PHP sessions are all stored on the server, not on the client.

Severance
11 Nov 2010, 9:43 AM
I know that, of course !

But it a strange behavior that I found there ! In safari, no problem, but when I launch the web app from the home page, the session is not reconize !

xnakxx
11 Nov 2010, 10:49 AM
http://stackoverflow.com/questions/3452867/iphone-web-app-not-storing-cookie
http://stackoverflow.com/questions/3813599/iphone-bookmark-to-homescreen-removes-cookies-and-session

other ppl are having the same issue. i would suggest using localstorage
i guess it depends on how much security matters to you tho.

Severance
12 Nov 2010, 5:12 AM
hello thanks for your reply, do you know if there are some examples / functions for an easy management of the localStorage object in sencha touch ?

mschwartz
12 Nov 2010, 6:52 AM
This seems to be a bug in the phone's browser.

PHP by default sets a cookie PHP_SESSID that it uses to track sessions. If the cookie is not sent by the browser, the session on the server side is lost.

Though typically the sessions are aged and expired, 15 minute default I think.