• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
set_cipher and set_flashdata cannot be used together

#1
Exclamation 
Hello,

Today i noticed a weird issue in CodeIgniter 2.2 (haven't tested this on CI 3 yet), then i installed a fresh CI and tested it and it happened again,

set_flashdata does not work in the following situation (i simplified as much as i could to get the exact reason):

Controller (Simplified):
PHP Code:
<?php

class Welcome extends CI_Controller {

 function 
__construct(){parent::__construct();}

 function 
index()
 {
 
$this->load->library('session');
 
$this->load->library('encrypt');
 
 
$this->encrypt->set_cipher(MCRYPT_BLOWFISH);
 
$this->encrypt->encode('message');
 
 
$this->session->set_flashdata('item''value');
 }



Config:
PHP Code:
$config['sess_encrypt_cookie'] = TRUE// Also set encryption_key config
$config['log_threshold'] = 1// To log the error 

Then when i open my controller and refresh again, Flash Data is not set, and also the following error is logged:

Code:
Severity: Notice  --> unserialize(): Error at offset 0 of 287 bytes /Applications/MAMP/htdocs/clean/system/libraries/Session.php 741

(If i delete either `$this->encrypt->set_cipher(MCRYPT_BLOWFISH);` or `$this->session->set_flashdata('item', 'value');` or change the config i mentioned, it doesn't happen again)

All i wanted to do, is encrypt a simple message with MCRYPT_BLOWFISH because the default encryption method result was too long for this porpuse (for anything else i wanted to use the default encryption)

Am i doing anything wrong or is this an actual bug? because i just followed the User Guide to do this Undecided
Reply


Messages In This Thread
set_cipher and set_flashdata cannot be used together - by noobie - 05-09-2015, 09:34 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.