Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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);
    }
}
?>

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
185 views
Welcome To Ask or Share your Answers For Others

1 Answer

Use this:

Landing_Page_Controller::index();

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...