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
Destroy Session When Broswer Tab Closed
Special Characters in "File_Exists" Problem (Php)
Generating Random Numbers from Skewed Normal Distribution
What Ocr Options Exist Beyond Tesseract
How to Put JavaScript Variable in PHP Echo
Return Multiple Response Data in One Response
Cast the Current Object ($This) to a Descendent Class
How to Count Same Values in an Array and Store It to a Variable
Insert Query Check If Record Exists - If Not, Insert It
Forget Password Page, Creating a Generated Password to Email to the User
Woocommerce: Display Some Reviews Randomly on Home Page
How to Find Number of Mondays or Tuesdays Between Two Dates
(Mysql, PHP) How to Get Auto_Increment Field Value Before Inserting Data
PHP Datetime() Class, Change First Day of the Week to Monday
How to Display an Blob Image Stored in MySQL Database
PHP - How to Parametrize SQL Query with Multiple Where Conditions (Prepared Statement)