Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
ebd8bd55
Commit
ebd8bd55
authored
Jul 21, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added http_only option to cookie::put method.
parent
d420d1c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
system/cookie.php
+17
-15
No files found.
system/cookie.php
View file @
ebd8bd55
...
...
@@ -28,38 +28,40 @@ class Cookie {
/**
* Set a "permanent" cookie. The cookie will last 5 years.
*
* @param string $name
* @param string $value
* @param string $path
* @param string $domain
* @param bool $secure
* @param string $name
* @param string $value
* @param string $path
* @param string $domain
* @param bool $secure
* @param bool $http_only
* @return bool
*/
public
static
function
forever
(
$name
,
$value
,
$path
=
'/'
,
$domain
=
null
,
$secure
=
false
)
public
static
function
forever
(
$name
,
$value
,
$path
=
'/'
,
$domain
=
null
,
$secure
=
false
,
$http_only
=
false
)
{
return
static
::
put
(
$name
,
$value
,
2628000
,
$path
,
$domain
,
$secure
);
return
static
::
put
(
$name
,
$value
,
2628000
,
$path
,
$domain
,
$secure
,
$http_only
);
}
/**
* Set the value of a cookie. If a negative number of minutes is
* specified, the cookie will be deleted.
*
* @param string $name
* @param string $value
* @param int $minutes
* @param string $path
* @param string $domain
* @param bool $secure
* @param string $name
* @param string $value
* @param int $minutes
* @param string $path
* @param string $domain
* @param bool $secure
* @param bool $http_only
* @return bool
*/
public
static
function
put
(
$name
,
$value
,
$minutes
=
0
,
$path
=
'/'
,
$domain
=
null
,
$secure
=
false
)
public
static
function
put
(
$name
,
$value
,
$minutes
=
0
,
$path
=
'/'
,
$domain
=
null
,
$secure
=
false
,
$http_only
=
false
)
{
if
(
$minutes
<
0
)
{
unset
(
$_COOKIE
[
$name
]);
}
return
setcookie
(
$name
,
$value
,
(
$minutes
!=
0
)
?
time
()
+
(
$minutes
*
60
)
:
0
,
$path
,
$domain
,
$secure
);
return
setcookie
(
$name
,
$value
,
(
$minutes
!=
0
)
?
time
()
+
(
$minutes
*
60
)
:
0
,
$path
,
$domain
,
$secure
,
$http_only
);
}
/**
...
...
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