1

My session gets reset very page load, resulting in a login page that doesn't work etc.

Using Google App Engine with PHP 7.2, Codeigniter Framework 3. Sessions get saved in database.

In Chrome developer tools at Application -> Cookies, the PHPSESSID cookie value changes at every page load. Domain is set to the correct subdomain. Expire date is 1969.

Calvin
  • 347
  • 1
  • 4
  • 18
  • You should provide the code you are using to set the cookie. It would seem like your expiration is not correct. – BA_Webimax Oct 17 '18 at 18:14
  • @BA_Webimax Just using standard Codeigniter 3 session library – Calvin Oct 17 '18 at 18:20
  • check value of PHPSESSID in php `$_COOKIE['PHPSESSID']` and see if it has the value, and look for `session_regenerate_id` in your code maybe you use it somewhere – Ali Akbar Azizi Oct 17 '18 at 18:25
  • I did var_dump($_COOKIE['PHPSESSID']) but it's empty – Calvin Oct 17 '18 at 18:33
  • @user1857116 It will be very difficult to help you if you don't provide any code. What's in `application/config/config.php` related to sessions and cookies? Are you autoloading the sessions library in `application/config/autoload.php`? How are you initializing the sessions? – BA_Webimax Oct 17 '18 at 18:33

1 Answers1

1

Apparently the issue wasn't with Google App Engine or my settings. It was a CodeIgniter bug.

If you encounter this too, make sure to upgrade your /system folder to the lastest CodeIgniter 3 version.

source: Codeigniter 3 Session not working With PHP 7.1.4

Calvin
  • 347
  • 1
  • 4
  • 18