Cakephp Session->write problem in linux


I have problem with cakephp's Session->write method.

If I set a value like $_SESSION['..'] i'm able to read it back. But if I use the write method it's not working.

My problem is same as here:

The same code was working in windows but it's not working after I moved to linux.

Any permission problem would be the reason? (but i have given rw permission fully for the cake app directory).

code sample: in the link:

  • Configure::write('', 'php');
  • Configure::write('Session.cookie', 'CAKEPHP');
  • Configure::write('Session.start', true);
  • Configure::write('Session.checkAgent', false);
  • Configure::write('Security.level', 'medium');

cake version:

Best Solution

Some steps to ensure it's not you:

  • clear the cache in your /app/tmp
  • check and recheck that your /app/tmp is world-writable recursively (that means drwxrwxrwx for all folders inside)
  • use Firebug to check your session cookie, maybe something has gone wrong with it

Last but not least, try to move your session persistence to your database (see:, just to test things out that way, you never know what you'll find.

Hopefully you'll find something if you try all these.

Related Question