CakePHP/PHP Session lost on another controller or on redirect

The problem may be one of these
1)First of all check if session.start is set to true in app/config/core.php

The problem arises when session has not been started in other controller or the view/method you are redirected to

2)Try adding seesion_start(); in the beforeFilter of controller you are redirected to.
Or may be one or all of below in core.php file
Configure::write(‘Security.cookie’, ‘cakephpfdebackend’);
Configure::write(‘Session.cookieTimeout’, 0);
Configure::write(‘Session.checkAgent’, false);
Configure::write(‘Session.cookie_secure’,false);
Configure::write(‘Session.referer_check’ ,false);
Configure::write(‘Session.defaults’, ‘php’);

I would say check if the session has started or not

In core php

1)Please check if seesion is started on top of page,check session id if it is changing on redirect.

2)Check header(location );
The url passed shouldn’t contain the protocol information i.e.http or https

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