File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/Illuminate/Cookie/Middleware Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ class EncryptCookies
2525 */
2626 protected $ except = [];
2727
28+ /**
29+ * Indicates if cookies should be serialized.
30+ *
31+ * @var bool
32+ */
33+ protected $ serialize = false ;
34+
2835 /**
2936 * Create a new CookieGuard instance.
3037 *
@@ -93,7 +100,7 @@ protected function decryptCookie($name, $cookie)
93100 {
94101 return is_array ($ cookie )
95102 ? $ this ->decryptArray ($ cookie )
96- : $ this ->encrypter ->decrypt ($ cookie , false );
103+ : $ this ->encrypter ->decrypt ($ cookie , $ this -> serialize );
97104 }
98105
99106 /**
@@ -108,7 +115,7 @@ protected function decryptArray(array $cookie)
108115
109116 foreach ($ cookie as $ key => $ value ) {
110117 if (is_string ($ value )) {
111- $ decrypted [$ key ] = $ this ->encrypter ->decrypt ($ value , false );
118+ $ decrypted [$ key ] = $ this ->encrypter ->decrypt ($ value , $ this -> serialize );
112119 }
113120 }
114121
@@ -129,7 +136,7 @@ protected function encrypt(Response $response)
129136 }
130137
131138 $ response ->headers ->setCookie ($ this ->duplicate (
132- $ cookie , $ this ->encrypter ->encrypt ($ cookie ->getValue (), false )
139+ $ cookie , $ this ->encrypter ->encrypt ($ cookie ->getValue (), $ this -> serialize )
133140 ));
134141 }
135142
You can’t perform that action at this time.
0 commit comments