Yii1.1 chttpsession Session Property Configuration item

Source: Internet
Author: User

This article records the session in the Main.php configuration options, only to record, because Yii itself session, has been encapsulated very strong, but too tough, also unavoidably lost a lot of details.

For detailed documentation please refer to: http://www.yiiframework.com/doc/api/1.1/CDbHttpSession

protected/config/main.php
    //Application Components
    ' components ' => array (
        ' session ' => array (
            ' class ' => ' chttpsession ',
            ' AutoStart ' => true,
            ' SessionID ' => ' Site session ID ',
            ' SessionName ' => ' Site session Name ',
            ' Savepath ' => '/path/to/session ',
            ' cookiemode ' => ' Allow ',
            ' Cookieparams ' => Array (
                ' domain ' => ' soyoung.com ',
                ' path ' => '/path/to/cookie ',
                ' httponly ' = > True
            ),
            ' timeout ' => 1440,
            ' gcprobability ' => 1,
            ' Usetransparentsessionid ' => true< c17/>),
    

Some property configuration items are listed here, which are detailed below to understand:

Class This property stores session AutoStart whether Session_Start () is turned on (), the default is true, and if False, the open () SessionID is set to the current session ID, that is, execution session_id () SessionName sets the current session Name, which executes Session_name (), defaults to PHPSESSID Savepath sets the save path for the session on the server, defaults to/tmp Cookiemode Set the cookie mode, which can set three values, Allow/none/only,allow allows Cookie;none to be used cookie;only only cookies are allowed. The default is allow Cookieparams Set cookie mode parameter timeout set a few seconds after the reply is idle, the default is 1440 gcprobability set garbage collection probability, the default is 1, that is 1% Usetransparentsessionid to set whether each page has a session ID

For action session, please search Google.

Remark: This article is original, reprint please mark the origin in the beginning ...

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.