问题
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. Ipad is fine doesn't have this issue.
Are the cookies 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.
回答1:
Having looked around it appears that the cause is safari on the iphone caching Ajax requests. Nothing to do with sessions at all. Adding a timestamp to my ajax request solved my issue.
var timestamp = new Date().getTime();
Off I go through all my js files looking for $.ajax :)
来源:https://stackoverflow.com/questions/12685171/issue-with-codeigniter-sessions-on-iphone