This is my controller action.
public function getData(){
if($this->request->is('ajax')) {
$session = $this->request->session();
$data=$session->read('User.access_token');
$this->set('data', $data);
$this->set('_serialize', 'data');
}
}
It is my controller action in cakephp 3.3. I want to getting my session data but it is showing error code 500 .I have already write session data and that is working on normal call of action. I also referred to https://stackoverflow.com/a/19861698/3110742
Below is my session write part.
public function oauthcallback(){
$session = $this->request->session();
$session->write('User.access_token', $google_sess);
}