The following simple controller highlights the issue I am having -
php
<?php /**
* Test Controller.
*
* app
* Controller_Rest
*/
class Controller_Test extends Controller_Rest {
public function before() {
parent::before();
$this->session = \Fuel\Core\Session::instance();
}
public function action_test() {
$this->session->set('user_id', 12345);
$this->response(array('sessionId' => $this->session->key('session_id')));
}
}
I need to be able to retrieve the key so that it can be sent as part of a JSON response as the client does not support cookies. The first time that I call /test/test I receive -
{"sessionId":false}
but on subsequent requests it generates -
{"sessionId":"9dddf3fcb058c181bee70e0238581880"}
该提问来源于开源项目:fuel/core