【问题标题】:How to configure 'cookie::$salt' in kohana如何在 kohana 中配置 'cookie::$salt'
【发布时间】:2013-05-05 03:27:51
【问题描述】:

在 Kohana 文档的这一部分中:(http://kohanaframework.org/3.1/guide/kohana/cookies) 它说我可以找到

Cookie::$salt = 'foobar';

在 bootstrap.php 中。

我在那里看不到它。是我太厚了,还是有更好的办法?

【问题讨论】:

    标签: cookies kohana salt


    【解决方案1】:

    默认情况下它不在bootstrap.php file 中。我已将它添加到文件中,在 Kohana::modules 之后和路由之前。

    【讨论】:

    • 将其添加到第 90 行。我将“foobar”更改为真正令人兴奋的东西。前任。 Cookie::$salt = '9urhkc74kws1@3fdksyYDelsicdkeakducjlwadc9#0';
    【解决方案2】:

    看起来配置在最新版本 3.3.4 中更新(在撰写本文时)

    134 /**
    135  * Cookie Salt
    136  * @see  http://kohanaframework.org/3.3/guide/kohana/cookies
    137  * 
    138  * If you have not defined a cookie salt in your Cookie class then
    139  * uncomment the line below and define a preferrably long salt.
    140  */
    141 // Cookie::$salt = NULL;
    142 Cookie::$salt = 'LOASWnL7A1WKQMk1JALCP1H5BMelyIPQNVdXiGsbEEVhVtyApGsFC6LyINUsDHl1';
    

    【讨论】:

      猜你喜欢
      • 2014-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-08
      • 2013-04-27
      相关资源
      最近更新 更多