Welcome Guest, Not a member yet? Register   Sign In
Sessions not working on the iphone
#1

[eluser]bobbob[/eluser]

My authentication uses CI sessions and works fine everywhere that I have checked. I just noticed that on the iPhone I can only login if I clear all cookies and data from the iPhone(safari) browser. I can log in once and then once I log out I can't log in again until I clear the data and cookies again.
On the first login the iphone doesn't lose its session and it is able to renew its session etc to stay logged in.
Ipad is fine doesn't have this issue.

Is the cookie being corrupted? has anyone come across this. I would like to be able to continue using CI sessions. I have toggled encrypting the cookie as someone suggested that. Didn't work.

Any thoughts much appreciated.

I am using the database to store sessions as in the User Guide.
sess_match_ip is set to False which will help on the phone network but this issue happens on wifi too.

This is how my session is set:

Code:
$sess_data = array(
     'email' => $email,
     'name' => $name,
     'logged_in' => 1,
     'user_id' => $id
     );
     $this->session->set_userdata($sess_data);


Thanks,


Small update. Tested the Chrome browser on the iphone and no issues.
This looks most likely to be a safari iphone bug


#2

[eluser]CroNiX[/eluser]
It could also be a cookie issue. What is the name of the cookie you are using for your sessions?
#3

[eluser]bobbob[/eluser]
Solved this by adding a timestamp to the ajax url making the login request.
Safari on the iphone caches all ajax requests!! Nothing to do with CI at all.

@CroNiX My cookie does not have underscores in its name. All lowercase one word. I think that is where you were heading.




Theme © iAndrew 2016 - Forum software by © MyBB