Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In order to use the Session class you are required to set an encryption key in your config file

Tags:

codeigniter

I am in the process of upgrading codeigniter from 1.7.2 to 2.0.1.

Everything seems to have gone ok except I get

In order to use the Session class you are required to set an encryption key in your config file.

What is the change in 2.0.0/2.0.1 that has caused this?

What change do I need to make to fix this.

Will making said change break anything?

like image 583
Hailwood Avatar asked Mar 22 '11 00:03

Hailwood


People also ask

How set encryption key in config file in CodeIgniter?

The CodeIgniter 2.0. 2 requires to set an encryption key in the config file i.e. $config['encryption_key'] , if you want to use Session class.

What is encryption key in CodeIgniter?

Setting your encryption_key An encryption key is a piece of information that controls the cryptographic process and permits a plain-text string to be encrypted, and afterwards - decrypted.


1 Answers

ohai again https://www.codeigniter.com/user_guide/libraries/encryption.html :D

The reason they ask for an encryption key is security (obviously)

Note: Even if you are not using encrypted sessions, you must set an encryption key in your config file which is used to aid in preventing session data manipulation. - source: https://www.codeigniter.com/user_guide/libraries/sessions.html

This modification won't break your code. But be careful when updating from 1.7.2 to 2.0.1. I suggest you to backup your code :)

BTW they added this security improvement with the 2.0.0 version of CI. I don't know why they don't mention it in their upgrade guide though :(

like image 140
Thomas Menga Avatar answered Sep 23 '22 06:09

Thomas Menga