Skip to content

Commit 936160f

Browse files
committed
Merge pull request laravel#1850 from rk/patch-1
Check application.ssl when setting a secure cookie
2 parents 9c9b6ee + 785e168 commit 936160f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

laravel/cookie.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public static function put($name, $value, $expiration = 0, $path = '/', $domain
8282

8383
$value = static::hash($value).'+'.$value;
8484

85+
// If the developer has explicitly disabled SLL, then we shouldn't force
86+
// this cookie over SSL.
87+
$secure = $secure && Config::get('application.ssl');
88+
8589
// If the secure option is set to true, yet the request is not over HTTPS
8690
// we'll throw an exception to let the developer know that they are
8791
// attempting to send a secure cookie over the insecure HTTP.

0 commit comments

Comments
 (0)