Browse Source

Rename "cookie_path" to "cookiePath" for consistency.

ADmad 11 years ago
parent
commit
bc68b864b8
3 changed files with 6 additions and 6 deletions
  1. 2 2
      src/Network/Request.php
  2. 3 3
      src/Network/Session.php
  3. 1 1
      tests/TestCase/Network/SessionTest.php

+ 2 - 2
src/Network/Request.php

@@ -159,7 +159,7 @@ class Request implements \ArrayAccess {
 		$sessionConfig = Hash::merge(
 			[
 				'defaults' => 'php',
-				'cookie_path' => $base ?: '/'
+				'cookiePath' => $base ?: '/'
 			],
 			(array)Configure::read('Session')
 		);
@@ -231,7 +231,7 @@ class Request implements \ArrayAccess {
 
 		if (empty($config['session'])) {
 			$config['session'] = new Session([
-				'cookie_path' => $config['base'] ?: '/'
+				'cookiePath' => $config['base'] ?: '/'
 			]);
 		}
 

+ 3 - 3
src/Network/Session.php

@@ -181,7 +181,7 @@ class Session {
  * ### Configuration:
  *
  * - timeout: The time in minutes the session should be valid for.
- * - cookie_path: The url path for which session cookie is set. Maps to the
+ * - cookiePath: The url path for which session cookie is set. Maps to the
  *   `session.cookie_path` php.ini config. Defaults to base path of app.
  * - ini: A list of php.ini directives to change before the session start.
  * - handler: An array containing at least the `class` key. To be used as the session
@@ -200,10 +200,10 @@ class Session {
 			$config['ini']['session.name'] = $config['cookie'];
 		}
 
-		if (isset($config['cookie_path']) &&
+		if (isset($config['cookiePath']) &&
 			!isset($config['ini']['session.cookie_path'])
 		) {
-			$config['ini']['session.cookie_path'] = $config['cookie_path'];
+			$config['ini']['session.cookie_path'] = $config['cookiePath'];
 		}
 
 		if (!empty($config['ini']) && is_array($config['ini'])) {

+ 1 - 1
tests/TestCase/Network/SessionTest.php

@@ -111,7 +111,7 @@ class SessionTest extends TestCase {
 		$_SESSION = null;
 
 		$config = array(
-			'cookie_path' => '/base',
+			'cookiePath' => '/base',
 			'cookie' => 'test',
 			'checkAgent' => false,
 			'timeout' => 86400,