File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,6 @@ public function isHttpOnly()
183
183
*/
184
184
public function isCleared ()
185
185
{
186
- return $ this ->expire < time ();
186
+ return 0 !== $ this -> expire && $ this ->expire < time ();
187
187
}
188
188
}
Original file line number Diff line number Diff line change @@ -153,6 +153,18 @@ public function testCookieIsCleared()
153
153
$ cookie = new Cookie ('foo ' , 'bar ' , time () - 20 );
154
154
155
155
$ this ->assertTrue ($ cookie ->isCleared (), '->isCleared() returns true if the cookie has expired ' );
156
+
157
+ $ cookie = new Cookie ('foo ' , 'bar ' );
158
+
159
+ $ this ->assertFalse ($ cookie ->isCleared ());
160
+
161
+ $ cookie = new Cookie ('foo ' , 'bar ' , 0 );
162
+
163
+ $ this ->assertFalse ($ cookie ->isCleared ());
164
+
165
+ $ cookie = new Cookie ('foo ' , 'bar ' , -1 );
166
+
167
+ $ this ->assertFalse ($ cookie ->isCleared ());
156
168
}
157
169
158
170
public function testToString ()
You can’t perform that action at this time.
0 commit comments