Welcome Guest, Not a member yet? Register   Sign In
Sessions and encrypted cookies problem
#1

[eluser]Dionysius[/eluser]
I have a problem with this topic.

My config.php:
Code:
$config['sess_cookie_name']        = 'sl_session';
$config['sess_expiration']        = 7200;
$config['sess_encrypt_cookie']    = TRUE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']        = 'ci_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']     = 300;

My $config['base_url'] is "<host>/<path>";

autoload.php:
Code:
$autoload['libraries'] = array( 'database', 'session' );
$autoload['helper'] = array( 'url', 'html' );

Then I go to <mySite> and Welcome controller is loaded (cookies are set). When I reload this page I get this error

Quote:A PHP Error was encountered

Severity: Warning

Message: mcrypt_decrypt() [function.mcrypt-decrypt]: The IV parameter must be as long as the blocksize

Filename: libraries/Encrypt.php

Line Number: 283

I have no any hacks, modifications, or extensions. I use clear CI 1.7.0
#2

[eluser]Dionysius[/eluser]
P.S. PHP version is 5.2.4
#3

[eluser]Vince Stross[/eluser]
is your encryption key set?
#4

[eluser]Dionysius[/eluser]
Yes, it is.
#5

[eluser]Vince Stross[/eluser]
How long is it? Any weird characters?

If it's really long try to shorten it, if it's short, make it longer.

Try messing with this because I have a feeling this is the problem.

Otherwise, are you able to ssh at root level to your server? There could be something with the mcrypt version and php version you are using.
#6

[eluser]Sam Dark[/eluser]
Having the same issue. Latest CI 1.7.
#7

[eluser]Sam Dark[/eluser]
Some details.

1. It seems to be platform specific. I'm not getting it at my development computer (Windows XP) and getting it at server from time to time.
2. It is CI bug, not third party code. Russian community members have repoduced it with clean CI installation at welcome page. Personally I'm getting it at server with SVN trunk version.

Will get more details soon.
#8

[eluser]Sam Dark[/eluser]
Config:
Code:
$config['encryption_key'] = "9fca5ef2eeb2d513a09302e130298b6";
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']     = 300;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
#9

[eluser]Sam Dark[/eluser]
Works when $config['sess_encrypt_cookie'] = FALSE; in all problematic cases.
#10

[eluser]Sam Dark[/eluser]
CI 1.7.0
PHP 5.2.4
User-agent Firefox 2.0.0.18




Theme © iAndrew 2016 - Forum software by © MyBB