Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
cbcc7b6a
Commit
cbcc7b6a
authored
Apr 23, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #2264: `CookieCollection::has()` will return false for expired or removed cookies
parent
84d4cd28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
CookieCollection.php
framework/web/CookieCollection.php
+4
-1
No files found.
framework/CHANGELOG.md
View file @
cbcc7b6a
...
...
@@ -20,6 +20,7 @@ Yii Framework 2 Change Log
-
Bug #3194: Date formatter works only for timestamps in the year range 1970 to 2038 (kartik-v)
-
Bug #3204:
`yii\di\Container`
did not handle the
`$config`
parameter well in case when it does not have a default value (qiangxue)
-
Bug #3216: Fixed the bug that
`yii.activeForm.destroy()`
did not remove
`submit`
event handlers (qiangxue)
-
Enh #2264:
`CookieCollection::has()`
will return false for expired or removed cookies (qiangxue)
-
Enh #2837: Error page now shows arguments in stack trace method calls (samdark)
-
Enh #3008: Added
`Html::errorSummary()`
(qiangxue)
-
Enh #3088: The debug and gii modules will manage their own URL rules now (hiltonjanfield, qiangxue)
...
...
framework/web/CookieCollection.php
View file @
cbcc7b6a
...
...
@@ -102,12 +102,15 @@ class CookieCollection extends Object implements \IteratorAggregate, \ArrayAcces
/**
* Returns whether there is a cookie with the specified name.
* Note that if a cookie is marked for deletion from browser, this method will return false.
* @param string $name the cookie name
* @return boolean whether the named cookie exists
* @see remove()
*/
public
function
has
(
$name
)
{
return
isset
(
$this
->
_cookies
[
$name
]);
return
isset
(
$this
->
_cookies
[
$name
])
&&
$this
->
_cookies
[
$name
]
->
value
!==
''
&&
(
$this
->
_cookies
[
$name
]
->
expire
===
null
||
$this
->
_cookies
[
$name
]
->
expire
>=
time
());
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment