如何在kohana框架中设置cookie [英] how to set cookie in kohana framework
本文介绍了如何在kohana框架中设置cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在kohana框架中设置和获取一个cookie,但我不知道如何在我的控制器中调用类cookie。
I am trying to set and get a cookie in kohana framework, but I don't know how to call the class cookie in my controller.
<?php
class Landing_Page_Controller extends Controller {
public function __construct() {
parent::__construct();
}
public function index() {
setcookie("kohanaSalt", "testKohanadata" , time()+3600);
}
}
?>
上面是一个从php设置cookie的简单方法,但是我想将这个cookie设置为
The above is a simple way to set a cookie from php, but I want to set this cookie into session and do so using kohana, if its possible.
推荐答案
使用:
Landing_Page_Controller::index();
这篇关于如何在kohana框架中设置cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文