I'm building a mobile webapp which is linked to a large web-based system.
Because of this I need to use cookies for the login and these don't seem to work when the webapp is added to the home screen.
I've read cookies can be created, but they are deleted when the webapp is closed, so they can't be shared with the safari app. Can I add and retrieve cookies in this home-screen-webapp to where safari stores them using Javascript or something else. The app is build with PHP and Javascript and uses AJAX to retrieve most content. The only times the page is loaded is at the start, after login and after logoff.
Is there a name used for these home-screen-webapp?
In the safari browser there is a small but annoying problem which I believe is caused by the cache. The login data is send in a <form> to another https location. This sets some data and redirects to the mobile webapp with a few GET values. This all works fine. The next time I visit the app, without the GET values, the app is shown like I'm not logged in, but the content retrieved with AJAX shows I am logged in. After a refresh I'm logged in as normal. This makes me think the first time the page is retrieved from the cache. The AJAX content isn't cached so this explaines this difference. These actions will be quite common, so I can't just tell the users keep refreshing. Can I prevent safari from caching the main page?
I've tried meta tags NO-CACHE, but this didn't work.
On a different divice with cache turned off everything works as it should.
The login form is send to a https file and this will redirect back to the webapp. (This might seem ugly, but because of the larger web-based system I can't solve this in a different way.) In desktop browsers and the safari app this works fine, but as a home-screen-webapp I get a white screen after the redirection and it stays this way. I can redirect to a website on the https server. Any idea what could go wrong here?
Edit:
The cookies turned out not to be a problem. After fixing the other problems it all worked.
the caching problem is solved by setting these headings in php (as meta tags they didn't work):
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
The last problem with the redirecting was caused by the certificate from the server.
Because of this I need to use cookies for the login and these don't seem to work when the webapp is added to the home screen.
I've read cookies can be created, but they are deleted when the webapp is closed, so they can't be shared with the safari app. Can I add and retrieve cookies in this home-screen-webapp to where safari stores them using Javascript or something else. The app is build with PHP and Javascript and uses AJAX to retrieve most content. The only times the page is loaded is at the start, after login and after logoff.
Is there a name used for these home-screen-webapp?
In the safari browser there is a small but annoying problem which I believe is caused by the cache. The login data is send in a <form> to another https location. This sets some data and redirects to the mobile webapp with a few GET values. This all works fine. The next time I visit the app, without the GET values, the app is shown like I'm not logged in, but the content retrieved with AJAX shows I am logged in. After a refresh I'm logged in as normal. This makes me think the first time the page is retrieved from the cache. The AJAX content isn't cached so this explaines this difference. These actions will be quite common, so I can't just tell the users keep refreshing. Can I prevent safari from caching the main page?
I've tried meta tags NO-CACHE, but this didn't work.
On a different divice with cache turned off everything works as it should.
The login form is send to a https file and this will redirect back to the webapp. (This might seem ugly, but because of the larger web-based system I can't solve this in a different way.) In desktop browsers and the safari app this works fine, but as a home-screen-webapp I get a white screen after the redirection and it stays this way. I can redirect to a website on the https server. Any idea what could go wrong here?
Edit:
The cookies turned out not to be a problem. After fixing the other problems it all worked.
the caching problem is solved by setting these headings in php (as meta tags they didn't work):
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
The last problem with the redirecting was caused by the certificate from the server.
Last edited: