Codeigniter Session Data Lost After Redirect

php - Session are lost after redirect in CodeIgniter 3

i just solved my problem turns out i have old version of codeigniter 3 i upgrade my CI to the latest version available on the website . thank you all for the help

Session Data Lost after redirecting to another controller in Codeigniter

Load database and session library from autoload.php file

$autoload['libraries'] = array('database', 'session');

Then you wouldn't need to add these twos' in every constructor. It will generate a unique session for the app. Give it a try.

Why does CODEIGNITER lost session after redirect to other controller by using redirect function?

I found a solution:

If you did not set base_url in the config.php file it redirects page to http://[::1]/something so it deletes session if you change your base url to localhost it works

Codeigniter session data lost after redirect (after using memcached as session storage)

Ok i think I have found the root cause.

Apparently one of my colleagues set a directive on index.php in the application that exceeds memcache's limitation, like this:

define('SESSION_TIME_OUT', x);
ini_set('session.gc_maxlifetime', SESSION_TIME_OUT);
ini_set('session.cache_expire', SESSION_TIME_OUT);
session_start();

Replace x with an appropriate number (memcache only accepts numbers under 2,592,000 or 30 days), then the issue no longer exists.



Related Topics



Leave a reply



Submit