Codeigniter sessions not working CI v 3.1.7 in chrome mobile android |
I recently discovered that my website login that uses CI v 3.1.7 and Ion Auth, doesn't work on my Android version of Chrome. It works in my Android Firefox and in Chrome/Firefox/Edge desktop. I cannot for the life of me figure out what the difference could be.
Code: $config['sess_driver'] = 'files'; Using chrome dev tools and my mobile device hooked up to my laptop I was able to get the session variables as expected only on success of the ajax request (using `print_r` and network response tab of dev tools). If I then went to any other page and tried `print_r`ing the session vars they no longer existed. The session cookie `fagardesigns_session` did not change between page reloads thus CI should be pulling the session vars just fine... It is almost like they were never written. I ran a separate test on a controller like: Code: class Test extends MY_Backend { and was able to get the session variables correctly after visiting `test/index` and then visting `test/index/test`. What could possibly be the issue? Obviously this question is very broad, but perhaps someone has either come across this issue before, or knows some troubleshooting steps I could take that I haven't thought of. UPDATE: As a last resort I uploaded my entire site to 000.webhost (free webhost) and tried it out. Same version of PHP, same everything except a different base_url and database connection (obviously). And it worked on my chrome mobile. Still have no clue... beginning to think there is a cookie or something in my phone that just won't delete despite me clearing Chrome's everything.
Do you discovered anything else about the problem? We're with the same problem here using CI 3.1.4. In our case, we testing on localhost and webhost and the problem occurs only in webhost. Others facts we discover:
If we discover anything else about the problem, I'll let you know.
I am having this same issue and I am using CI 3.1.3 with Ion Auth. On Android Firefox login works but with Android Chrome it refuses to login.
However Chrome on laptop works perfectly. Please help with any suggestions.
I used my moms android phone to test and it worked fine (the only other android phone I've got access to). It seems to have something to do with the combination of my phone + my live website (not a backup website with a different host) + chrome ONLY. Strange, and the fact that I can't replicate it on other devices caused me to give up. I know it had something to do with AJAX. Made a test page with no js, and could login normally and the session would stick. The second I introduced AJAX - even if it was just a request on a separate page after the user had already been logged in - the session "restarted" i.e. cleared everything.
Strange issue.
(08-05-2018, 10:29 PM)alex.fagard Wrote: I used my moms android phone to test and it worked fine (the only other android phone I've got access to). It seems to have something to do with the combination of my phone + my live website (not a backup website with a different host) + chrome ONLY. Strange, and the fact that I can't replicate it on other devices caused me to give up. I know it had something to do with AJAX. Made a test page with no js, and could login normally and the session would stick. The second I introduced AJAX - even if it was just a request on a separate page after the user had already been logged in - the session "restarted" i.e. cleared everything. This is a very bad issue from Chrome when used in "Lite Mode". Lite mode reduces bandwidth consumption but it lose php session variable. If you disable Chrome Lite Mode, this problem is solved! |
Welcome Guest, Not a member yet? Register Sign In |