What's wrong with using the session to save some global data?

Source: Internet
Author: User
Tags yii
Title, these data are some common data (such as site information, etc.). A friend of mine asked me if I wanted to pass variables across the controller in Yii, and I said that in the configuration file and using Redis and memcache, he couldn't say well. At last I said throw it to the session and then be despised. What do you think of it?

ps:一个刚出道的php请教。

Reply content:

Title, these data are some common data (such as site information, etc.). A friend of mine asked me if I wanted to pass variables across the controller in Yii, and I said that in the configuration file and using Redis and memcache, he couldn't say well. At last I said throw it to the session and then be despised. What do you think of it?

ps:一个刚出道的php请教。

If all users share information can be put in the cache, but also have to have persistent storage, for the unchanging data can be placed in the configuration file;
If it is a single session of the user data, the session is not a problem, I do not know what your friends have a brilliant idea

It's OK to save some global data, as long as it's not too big. If it's just a temporary deposit, it's good to delete it.

  • 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.