Undefined variable: _SESSION [APP\Controller\UsersController.php in cakephp 2.0 -


undefined variable: _session [app\controller\userscontroller.php in cakephp 2.0 

have included session component in

userscontroller var $components = array('session', 'cookie'); 

code that:

if(!empty($id)) {                   print "<br><pre>";           print_r($_session['text']);    print "<br><pre>";    print_r($this->session->read("captchatext"));    die;      }   else {    $_session['text'] = "jjsssssjj";    $this->session->write("captchatext", "ddddddssssssssssdddd");    print "ddddddssssssssssdddd"; } 

try

public $components = array('session');    

and why not use cakephp syntax reading session like:

   print "<br><pre>";           print_r($this->session->read('text'));    print "<br><pre>"; 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -