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
beb1564e
Unverified
Commit
beb1564e
authored
6 years ago
by
Jaime Pérez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Stop using the SessionHandlerPHP::sessionStart() method. It no longer serves any purpose.
parent
540b529c
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
+4
-30
4 additions, 30 deletions
lib/SimpleSAML/SessionHandlerPHP.php
with
4 additions
and
30 deletions
lib/SimpleSAML/SessionHandlerPHP.php
+
4
−
30
View file @
beb1564e
...
...
@@ -93,32 +93,6 @@ class SessionHandlerPHP extends SessionHandler
}
/**
* This method starts a session, making sure no warnings are generated due to headers being already sent.
*/
private
function
sessionStart
()
{
$cacheLimiter
=
session_cache_limiter
();
if
(
headers_sent
())
{
/*
* session_start() tries to send HTTP headers depending on the configuration, according to the
* documentation:
*
* http://php.net/manual/en/function.session-start.php
*
* If headers have been already sent, it will then trigger an error since no more headers can be sent.
* Being unable to send headers does not mean we cannot recover the session by calling session_start(),
* so we still want to call it. In this case, though, we want to avoid session_start() to send any
* headers at all so that no error is generated, so we clear the cache limiter temporarily (no headers
* sent then) and restore it after successfully starting the session.
*/
session_cache_limiter
(
''
);
}
session_cache_limiter
(
$cacheLimiter
);
@
session_start
();
}
/**
* Restore a previously-existing session.
*
...
...
@@ -148,7 +122,7 @@ class SessionHandlerPHP extends SessionHandler
);
session_id
(
$this
->
previous_session
[
'id'
]);
$this
->
previous_session
=
[];
$this
->
session
S
tart
();
@
session
_s
tart
();
/*
* At this point, we have restored a previously-existing session, so we can't continue to use our session here.
...
...
@@ -196,7 +170,7 @@ class SessionHandlerPHP extends SessionHandler
throw
new
\SimpleSAML\Error\Exception
(
'Session start with secure cookie not allowed on http.'
);
}
$this
->
session
S
tart
();
@
session
_s
tart
();
return
session_id
();
}
...
...
@@ -246,7 +220,7 @@ class SessionHandlerPHP extends SessionHandler
}
session_id
(
$sessionId
);
$this
->
session
S
tart
();
@
session
_s
tart
();
}
elseif
(
$sessionId
!==
session_id
())
{
throw
new
\SimpleSAML\Error\Exception
(
'Cannot load PHP session with a specific ID.'
);
}
...
...
@@ -357,6 +331,6 @@ class SessionHandlerPHP extends SessionHandler
);
session_id
(
$sessionID
);
$this
->
session
S
tart
();
@
session
_s
tart
();
}
}
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