Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Yeray Santana Hualde
syncEnrollments
Commits
de72602c
Commit
de72602c
authored
Nov 23, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cookie payload class constant.
parent
ba300e02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
cookie.php
laravel/session/drivers/cookie.php
+13
-4
No files found.
laravel/session/drivers/cookie.php
View file @
de72602c
...
...
@@ -4,6 +4,13 @@ use Laravel\Crypter;
class
Cookie
implements
Driver
{
/**
* The name of the cookie used to store the session payload.
*
* @var string
*/
const
payload
=
'session_payload'
;
/**
* Load a session from storage by a given ID.
*
...
...
@@ -14,9 +21,11 @@ class Cookie implements Driver {
*/
public
function
load
(
$id
)
{
if
(
\Laravel\Cookie
::
has
(
'session_payload'
))
if
(
\Laravel\Cookie
::
has
(
Cookie
::
payload
))
{
return
unserialize
(
Crypter
::
decrypt
(
\Laravel\Cookie
::
get
(
'session_payload'
)));
$cookie
=
Crypter
::
decrypt
(
\Laravel\Cookie
::
get
(
Cookie
::
payload
));
return
unserialize
(
$cookie
);
}
}
...
...
@@ -34,7 +43,7 @@ class Cookie implements Driver {
$payload
=
Crypter
::
encrypt
(
serialize
(
$session
));
\Laravel\Cookie
::
put
(
'session_payload'
,
$payload
,
$lifetime
,
$path
,
$domain
);
\Laravel\Cookie
::
put
(
Cookie
::
payload
,
$payload
,
$lifetime
,
$path
,
$domain
);
}
/**
...
...
@@ -45,7 +54,7 @@ class Cookie implements Driver {
*/
public
function
delete
(
$id
)
{
\Laravel\Cookie
::
forget
(
'session_payload'
);
\Laravel\Cookie
::
forget
(
Cookie
::
payload
);
}
}
\ No newline at end of file
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