Permalink
Browse files

FIX Fallback for Session.cookie_path

Regression introduced by Config API static changes.
Effectively meant that you can no longer log in to the CMS
since the cookie path is set for each URL individually...
  • Loading branch information...
1 parent 7470f5e commit 07d99a5136b333bd22cb2dc1a3541097e67685d6 @chillu chillu committed Mar 25, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 control/Session.php
View
@@ -497,6 +497,7 @@ public static function setFormMessage($formname,$message,$type){
*/
public static function start($sid = null) {
$path = Config::inst()->get('Session', 'cookie_path');
+ if(!$path) $path = Director::baseURL();
$domain = Config::inst()->get('Session', 'cookie_domain');
$secure = Config::inst()->get('Session', 'cookie_secure');
$session_path = Config::inst()->get('Session', 'session_store_path');
@@ -528,6 +529,7 @@ public static function destroy($removeCookie = true) {
if(session_id()) {
if($removeCookie) {
$path = Config::inst()->get('cookie_path');
+ if(!$path) $path = Director::baseURL();
$domain = Config::inst()->get('cookie_domain');
$secure = Config::inst()->get('cookie_secure');

0 comments on commit 07d99a5

Please sign in to comment.