Cakephp getting session variable in model without using Auth component -
i want session variables in model. im not using auth component. there alternate way ?
thanks binoy
you need use session helper do,
$this->session->write('key','value');
but comment states, you'll wanting set variable in model , use session write same value variable in model, rather accessing session in model.
class mymodel extends appmodel{ var $username; var $password; }
then in controller use along lines of,
$this->mymodel->username = $this->session->read('user.id'); $this->mymodel->password = $this->session->read('user.password');
Comments
Post a Comment