Kohana_Exception [ 0 ]: A valid cookie salt is required. Please set Cookie::$salt

感情迁移 提交于 2020-01-13 11:35:15

问题


I'm working through this tutorial (http://kowsercse.com/2011/09/04/kohana-tutorial-beginners/) and have run into this error message:

Kohana_Exception [ 0 ]: A valid cookie salt is required. Please set Cookie::$salt.

I'm a n00b and don't even know where to look for Cookie::$salt in the app.


回答1:


You have to provide a salt as you can read in the official documentation

//bootstrap.php
Cookie::$salt = 'foobar';

I can highly recommend the official doc as well as the API browser. When you learn how Kohana works, you will learn first of all the meaning of the error messages and how you can handle them yourself




回答2:


Find file: bootstrap.php (www\kohana\application).

Paste this:

Cookie::$salt = 'foobar';

That will be fine.




回答3:


It's not in the bootstrap.php file by default. I've added it to the file, after Kohana::modules and before the routes. and it is working fine now... (copied)



来源:https://stackoverflow.com/questions/16357998/kohana-exception-0-a-valid-cookie-salt-is-required-please-set-cookiesal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!