Skip to content

セッションの有効期限 #66

@kteraguchi

Description

@kteraguchi

NC2では、セッションの有効期限を0にしていました。
https://github.com/netcommons/NetCommons2/blob/develop/html/maple/filter/Filter_SetConfig.class.php#L210

CakePHPのデフォルトはPHPの設定を使用するようです。
https://github.com/cakephp/cakephp/blob/1af5d23e87d895e73163c55a930d9980404203c1/app/Config/core.php#L217-L219
(おそらく1440秒)

上記箇所を書き換えると有効期限も設定できます。
http://book.cakephp.org/2.0/ja/development/sessions.html
から抜粋

Configure::write('Session', array(
    'defaults' => 'php',
    'timeout' => 2160, // 36 hours
    'ini' => array(
        'session.gc_maxlifetime' => 129600 // 36 hours
    )
));

gc_maxlifetimeに対する設定も必要で単位が違うことに注意です。

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions