• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.