• Register
0 votes
227 views

Problem :

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

Everything seems to have gone as expected except I get below error:

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

What is a change in 2.0.0/2.0.1 that has caused above error?

What change should I do to fix the above error.

Will making the said change break anything for me?

3.9k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

The reason they are asking you for an encryption key is for security (obviously)

Note: Even if you are not using the encrypted sessions, still you must set the encryption key in the config file which should be used to aid in preventing your session data manipulation. -

This modification will not break your code. But be very careful when updating it from 1.7.2 to 2.0.1. I suggest you must backup your code before updating it.

They have added a security improvement with a 2.0.0 version of the CI. I don't know why they did not talk about it in their upgrade guide though.

OR

If you use a Encryption class or a Session class then you MUST set the encryption key. Please see a user guide for info on it.

$config['encryption_key'] = '02527-269-2503946-70386-34730519'; 
38.6k points

Related questions

0 votes
1 answer 4 views
4 views
Problem : You must use the set method to update an entry.
asked Jul 1 Isac Christiaan 103k points
0 votes
1 answer 2 views
2 views
Problem : You must use the "set" method to update an entry.
asked Jun 29 Siam55 110k points
0 votes
1 answer 12 views
12 views
Question: I have a controller named admin,and all functions in the controller can be used if the session variable is set,so what are the best ways to check if the session is set ,when clicking each link in the page or reloading the pages... for example: if i open my admin ... , bt after that in the second tab all links a working properly so i want to check if the session is set or not... Thanks!
asked Apr 13 Atik03 26.5k points
0 votes
1 answer 117 views
117 views
Problem: I use Windows 10 and in cmd I want to use the command sfc /scannow Cmd then gives me this message You must be an administrator running a console session in order to use the sfc utility. I then try to open cmd by right-clicking and press Run as Administrator. But then I get this error. How can I solve this?
asked Apr 24 Yeamin 23.5k points
0 votes
1 answer 23 views
23 views
Problem: I use Windows 10 and in cmd I want to use the command sfc /scannow Cmd then gives me this message You must be an administrator running a console session in order to use the sfc utility. I then try to open cmd by right-clicking and press Run as Administrator. But then I get this error. How can I solve this?
asked Apr 24 sumaiya simi 43.9k points
0 votes
1 answer 222 views
0 votes
1 answer 27 views
27 views
Problem: Give me an answer please : Session: configured save path 'c:\windows\temp' is not writable by the php process.
asked Jun 13 Sawyer Parviz 168k points
0 votes
1 answer 39 views
39 views
Problem: Is there somebody who can assist : Session: configured save path '' is not a directory, doesn't exist or cannot be created?
asked Jun 12 Mezbah 130k points
0 votes
1 answer 29 views
29 views
Problem: What is the solution : Message: session: configured save path '' is not a directory, doesn't exist or cannot be created?
asked Jun 10 Irenka Kiri 85.5k points
0 votes
1 answer 49 views