CakePHP 2.3 sets the Session variables (including cookie attributes) in the core.php file. I need to set samesite=None
and Secure=true
for the session cookie, but it doesn't appear to have those settings available in the configuration, which shows only the following options:
Session.cookie
- The name of the cookie to use. Defaults to 'CAKEPHP'Session.timeout
- The number of minutes you want sessions to live for. This timeout is handled by CakePHPSession.cookieTimeout
- The number of minutes you want session cookies to live for.Session.checkAgent
- Do you want the user agent to be checked when starting sessions? You might want to set the value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAXSession.defaults
- The default configuration set to use as a basis for your session. There are four builtins: php, cake, cache, database.Session.handler
- Can be used to enable a custom session handler. Expects an array of of callables, that can be used withsession_save_handler
. Using this option will automatically addsession.save_handler
to the ini array.Session.autoRegenerate
- Enabling this setting, turns on automatic renewal of sessions, and sessionids that change frequently. See CakeSession::$requestCountdown.Session.ini
- An associative array of additional ini values to set.
This is how I have it now:
Configure::write('Session', array(
'defaults' => 'database',
'handler' => array('model' => 'cake_sessions'),
'timeout' => 60
));
Is there a workaround for this? I've been looking at how to do this with php but I'm not sure how I would edit the session cookie that CakePHP creates with the attributes I want, or if that is possible at all once the cookie has been created.