Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
b278b2b4
Unverified
Commit
b278b2b4
authored
5 years ago
by
Jaime Pérez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Fix header warnings from log flushing
This resolves #1176
parent
3fa2c2d7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/SimpleSAML/SessionHandlerPHP.php
+6
-1
6 additions, 1 deletion
lib/SimpleSAML/SessionHandlerPHP.php
with
6 additions
and
1 deletion
lib/SimpleSAML/SessionHandlerPHP.php
+
6
−
1
View file @
b278b2b4
...
@@ -189,6 +189,11 @@ class SessionHandlerPHP extends SessionHandler
...
@@ -189,6 +189,11 @@ class SessionHandlerPHP extends SessionHandler
return
null
;
// there's no session cookie, can't return ID
return
null
;
// there's no session cookie, can't return ID
}
}
if
(
version_compare
(
PHP_VERSION
,
'7.2'
,
'ge'
)
&&
headers_sent
())
{
// latest versions of PHP don't allow loading a session when output sent, get the ID from the cookie
return
$_COOKIE
[
$this
->
cookie_name
];
}
// do not rely on session_id() as it can return the ID of a previous session. Get it from the cookie instead.
// do not rely on session_id() as it can return the ID of a previous session. Get it from the cookie instead.
session_id
(
$_COOKIE
[
$this
->
cookie_name
]);
session_id
(
$_COOKIE
[
$this
->
cookie_name
]);
...
@@ -241,7 +246,7 @@ class SessionHandlerPHP extends SessionHandler
...
@@ -241,7 +246,7 @@ class SessionHandlerPHP extends SessionHandler
assert
(
is_string
(
$sessionId
)
||
$sessionId
===
null
);
assert
(
is_string
(
$sessionId
)
||
$sessionId
===
null
);
if
(
$sessionId
!==
null
)
{
if
(
$sessionId
!==
null
)
{
if
(
session_id
()
===
''
)
{
if
(
session_id
()
===
''
&&
!
(
version_compare
(
PHP_VERSION
,
'7.2'
,
'ge'
)
&&
headers_sent
())
)
{
// session not initiated with getCookieSessionId(), start session without setting cookie
// session not initiated with getCookieSessionId(), start session without setting cookie
$ret
=
ini_set
(
'session.use_cookies'
,
'0'
);
$ret
=
ini_set
(
'session.use_cookies'
,
'0'
);
if
(
$ret
===
false
)
{
if
(
$ret
===
false
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment