The CI framework automatically loads sessions and reports errors.

Source: Internet
Author: User
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 the CI framework.

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.