Welcome Guest, Not a member yet? Register   Sign In
set_flashdata & session timeout
#1

(This post was last modified: 08-16-2018, 10:49 PM by rhodium.)

I recently updated from CI 3.1.3 to 3.1.9 and I am now experiencing some strange issues with set_flashdata. 

All session features involving set_userdata() and userdata() work flawlessly. 


Code:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'sess_';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = APPPATH.'/ci_sessions/';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

My controller creates a success/confirmation message as flashdata, then followed to a redirect that will output the said message:


Code:
$this->session->set_flashdata('success_message', 'Success!');
redirect( base_url('account/page') );

The page located at account/page successfully displays the success message.  

What happens after this is puzzling. Any action/link I click after this leads to a session timeout. (All pages in this application are protected by session variables and require a logged in user.) The error message taken from the logs looks like this:


Code:
ERROR - 2018-08-15 12:02:39 --> Severity: Error --> Maximum execution time of 300 seconds exceeded
/home/project/public_html/system/libraries/Session/drivers/Session_files_driver.php 212

I ran some test to see if the session variables were still present and they are. (I output all userdata() right after showing the flashdata message, the Profiler also indicates that all session variables are still present.) 

Commenting out the set_flashdata resolves the issue. Anyone experiencing such issues with 3.1.9? (I had no issues with 3.1.3) Perhaps I messed up the update to 3.1.9... 

Any ideas?

UPDATE: I downgraded to 3.1.8 and it resolved the issue. FYI, when using 3.1.9, the session does not necessarily time out, but the page load following the flashdata usage leads to an EXTREMELY slow page load if the page uses sessions. ( well over 3-4 minutes and sometimes times out after 300 seconds. )
Reply
#2

The following where added to session in 3.1.9 to prevent a security concern. Are you using PHP 5? As far as I can see it should only affect those systems.
https://github.com/bcit-ci/CodeIgniter/c...e4bb84c813
Reply
#3

(08-17-2018, 04:14 AM)jreklund Wrote: The following where added to session in 3.1.9 to prevent a security concern. Are you using PHP 5? As far as I can see it should only affect those systems.
https://github.com/bcit-ci/CodeIgniter/c...e4bb84c813

Hi jreklund, sorry for the late reply. As stated in my original post, I have "downgraded" to CI 3.1.8 for now.

I am using PHP 7.0.

The changelog for 3.1.9 only mentions the use of session.use_strict_mode, which was added in PHP 5.5.2 (http://php.net/manual/en/session.configuration.php)

Any ideas?
Reply
#4

(This post was last modified: 08-30-2018, 08:09 AM by InsiteFX.)

PHP 7.2.9 has been release you should upgrade to it.

Try using this:

PHP Code:
$this->session->keep_flashdata('item'); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB