I created session in CakePHP like this:
$User = array('userid'=>232, 'access'=>1)
$this->Session->write('User',$User);
Now I want to check userid
in session using JavaScript / jQuery
Is there any direct method to access this session in JavaScript.
Thanks
Is there any direct method access this session in JavaScript directly.
No. Session data is stored on the server.
In order to access it, you need to expose it on a URI via PHP, and then make an HTTP request to that URI (possibly using Ajax).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With