File tree 1 file changed +10
-3
lines changed
src/Illuminate/Cookie/Middleware
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ class EncryptCookies
25
25
*/
26
26
protected $ except = [];
27
27
28
+ /**
29
+ * Indicates if cookies should be serialized.
30
+ *
31
+ * @var bool
32
+ */
33
+ protected $ serialize = false ;
34
+
28
35
/**
29
36
* Create a new CookieGuard instance.
30
37
*
@@ -93,7 +100,7 @@ protected function decryptCookie($name, $cookie)
93
100
{
94
101
return is_array ($ cookie )
95
102
? $ this ->decryptArray ($ cookie )
96
- : $ this ->encrypter ->decrypt ($ cookie , false );
103
+ : $ this ->encrypter ->decrypt ($ cookie , $ this -> serialize );
97
104
}
98
105
99
106
/**
@@ -108,7 +115,7 @@ protected function decryptArray(array $cookie)
108
115
109
116
foreach ($ cookie as $ key => $ value ) {
110
117
if (is_string ($ value )) {
111
- $ decrypted [$ key ] = $ this ->encrypter ->decrypt ($ value , false );
118
+ $ decrypted [$ key ] = $ this ->encrypter ->decrypt ($ value , $ this -> serialize );
112
119
}
113
120
}
114
121
@@ -129,7 +136,7 @@ protected function encrypt(Response $response)
129
136
}
130
137
131
138
$ response ->headers ->setCookie ($ this ->duplicate (
132
- $ cookie , $ this ->encrypter ->encrypt ($ cookie ->getValue (), false )
139
+ $ cookie , $ this ->encrypter ->encrypt ($ cookie ->getValue (), $ this -> serialize )
133
140
));
134
141
}
135
142
You can’t perform that action at this time.
0 commit comments