When many programmers use sessions in CI, the website reports an error after the session is automatically loaded. This article mainly introduces how to report errors when the CI framework automatically loads sessions, for more information, see when many programmers use session in CI, the website reports an error after the session is automatically loaded. The error message is as follows: in order to use the Session class you are required to set an encryption key
Let's take a look at the solution.
Note:To use the session class, you must set an encryption key.! Let's set one. After all, it is also out of security considerations.
Open application/config. php and find the Encryption Key.
The Code is as follows:
/*
| --------------------------------------------------------------------------
| Encryption Key
| --------------------------------------------------------------------------
| If you use the Encryption class or the Session class you
| MUST set an encryption key. See the user guide for info.
*/
$ Config ['encryption _ key'] = 'xxxxx'; // you can add a key here!