Jump to content

php sessions not working on Apple iPad and iPhone


Recommended Posts

Hi all!


I have a very strange situation.


I have a webpage, built using PHP, where a visitor shall register his/her first name, last name, e-mail, phone and that choose a dish from a drop-down list. All this takes place using a form that is posted to a "process.php" script which validates the form and then put the data into SESSIONs. A confirm page shows the entered data to the visitor before it is being stored into a database. Pretty common scenario I would assume.


The problem I face, is that empty data are being put into the database.


After some communication with some of the visitors, I've managed to narrow it down to be related to Apple iPad and/or iPhone users who try to enter their information.


Pretty weird!


Anyone else who have experienced this?

Maybe someone have a solution?


Many thanks in advance!




Link to comment
Share on other sites

You have narrowed it down to mobile devices, but have you checked to make sure the mobile browser they are using is accepting cookies.


PHP passes the session id number (by default called PHPSESSID) via cookies. This is how PHP identifies you and manages to remember the data stored in the session. If PHP cannot recieve the session id then the data stored will not be retrievable and so this could be why you are getting empty records in your database.


To work out weather it is a cookie issue, try passing the PHPSESSID within the url.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.