CakePHP Session Issues


CakePHP’s handling of session variables appears very complex .It create confusion when $_SESSION variables are added within code not working. In Core.php we found default

Configure::write(‘Session.cookie’, ‘CAKEPHP’);

and session varriable set by cakePHP app will not be accessed by using $_SESSION. For make it work we have to made change in cakePHP core.php file. We have to add line

Configure::write(‘Session.cookie’, ‘PHPSESSID’);

 Now  $_SESSION vars will be accessed  across both areas.


Note: the session cookie name just needs to correspond to the session name in your php.ini file – the default is PHPSESSID.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s