Php – Session created with wrong permissions

magentoPHP

Is there a way to modify the permissions on generated session files? The system is writing the files to /var/session directory correctly, but without the proper access permissions (resulting in no carts or admin access):

-rw------- 1 [user] [group]   1271 2014-07-21 14:08 sess_lbqm0lbun5mlo89qvubg66keg1

I can chmod them easy enough, but would rather not have to do that every time a session is created.

Best Answer

Try giving writing/reading permission to the entire dir, not to the single session files. By that i mean chmod the var/sessions and not the files inside it.

Another solution for the no carts or admin access is to save the sessions in the database. That can be achieved by changing the content of the <session_save><![CDATA[files]]></session_save> node for <session_save><![CDATA[db]]></session_save> in the local.xml.