Session data removed or overwritten |
I have set up an update to fail with a database error. I catch the error, log to file, and store an error message for display. Unfortunately, when I redirect to a summary page the messages disappear from my session. The summary page contains a variable to display any messages or '' if none.
Each controller inherits a controller that checks the authentication Code: if (!$this->ion_auth->logged_in()) Here is where I set the message in the session variables: message and ud_message Code: // This method call deliberately set to fail with db error Here is the code in the ledger controller where I check the session variable for error messages Code: //Checking for the existence of the flash message The identity (Ion Auth) values remain in the session but the other items I added in the error get removed or over-written. Here is the session printed inside the try catch immediately after setting the flash and userdata variables: Array ( [__ci_last_regenerate] => 1450750143 [identity] => [email protected] [username] => so and so [email] => [email protected] [user_id] => 2 [old_last_login] => 3333344444 [message] => Unable to update donation record [__ci_vars] => Array ( [message] => new ) [ud_message] => UD Unable to update donation record ) 1 Here is the the session printed out in the ledger controller Array ( [__ci_last_regenerate] => 1450750445 [identity] => [email protected] [username] => so and so [email] => [email protected] [user_id] => 2 [old_last_login] => 3333344444 ) 1 Any suggestions would be much appreciated |
Messages In This Thread |
Session data removed or overwritten - by Shawn - 12-21-2015, 07:01 PM
RE: userdata removed from session appears to be working - by Avenirer - 12-21-2015, 11:55 PM
RE: userdata removed from session appears to be working - by Shawn - 12-22-2015, 10:32 AM
RE: Session data removed or overwritten - by Shawn - 12-22-2015, 11:49 AM
RE: Session data removed or overwritten - SOLVED - by Shawn - 01-03-2016, 03:38 PM
RE: Session data removed or overwritten - SOLVED - by Narf - 01-03-2016, 05:45 PM
|