summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaime Perez <jaime.perez@uninett.no>2014-07-08 15:02:11 +0200
committerJaime Perez <jaime.perez@uninett.no>2014-07-08 15:02:11 +0200
commitb9e02004f2d14b4b11355db3cf94fbf770f4fd3a (patch)
tree8ca8c0884c2dc79846ba272436157c71e47cd1b1
parentb8724609ee1e6ff40b22afd269cb2bca7b4ec9f7 (diff)
downloadsimplesamlphp-b9e02004f2d14b4b11355db3cf94fbf770f4fd3a.zip
simplesamlphp-b9e02004f2d14b4b11355db3cf94fbf770f4fd3a.tar.gz
simplesamlphp-b9e02004f2d14b4b11355db3cf94fbf770f4fd3a.tar.bz2
Rename SimpleSAML_Session::getInstance() to SimpleSAML_Session::getSessionFromRequest(), and leave the former as deprecated.
-rwxr-xr-xbin/pack.php2
-rw-r--r--docs/simplesamlphp-sp-migration.txt2
-rw-r--r--lib/SimpleSAML/Auth/BWC.php4
-rw-r--r--lib/SimpleSAML/Auth/Default.php8
-rw-r--r--lib/SimpleSAML/Auth/Simple.php12
-rw-r--r--lib/SimpleSAML/Auth/Source.php6
-rw-r--r--lib/SimpleSAML/Auth/State.php6
-rw-r--r--lib/SimpleSAML/Error/Error.php4
-rw-r--r--lib/SimpleSAML/IdP.php10
-rw-r--r--lib/SimpleSAML/Logger.php2
-rw-r--r--lib/SimpleSAML/Session.php13
-rw-r--r--lib/SimpleSAML/Utilities.php8
-rw-r--r--lib/SimpleSAML/XHTML/IdPDisco.php2
-rw-r--r--modules/InfoCard/www/getcardform.php2
-rw-r--r--modules/InfoCard/www/login-infocard.php2
-rw-r--r--modules/core/lib/Auth/Process/ExtendIdPSession.php2
-rw-r--r--modules/core/www/bwc_resumeauth.php2
-rw-r--r--modules/core/www/frontpage_auth.php2
-rw-r--r--modules/core/www/frontpage_config.php2
-rw-r--r--modules/core/www/frontpage_federation.php2
-rw-r--r--modules/core/www/frontpage_welcome.php2
-rw-r--r--modules/core/www/idp/resumeauth.php2
-rw-r--r--modules/core/www/postredirect.php2
-rw-r--r--modules/core/www/show_metadata.php2
-rw-r--r--modules/cron/www/croninfo.php2
-rw-r--r--modules/logpeek/www/index.php2
-rw-r--r--modules/metaedit/www/xmlimport.php2
-rw-r--r--modules/multiauth/lib/Auth/Source/MultiAuth.php4
-rw-r--r--modules/negotiate/lib/Auth/Source/Negotiate.php4
-rw-r--r--modules/negotiate/www/disable.php2
-rw-r--r--modules/negotiate/www/enable.php2
-rw-r--r--modules/negotiate/www/retry.php2
-rwxr-xr-xmodules/oauth/bin/demo.php2
-rw-r--r--modules/oauth/www/authorize.php2
-rw-r--r--modules/oauth/www/registry.edit.php2
-rw-r--r--modules/oauth/www/registry.php2
-rw-r--r--modules/openid/lib/SessionStore.php6
-rw-r--r--modules/saml/lib/Auth/Source/SP.php4
-rw-r--r--modules/saml/lib/IdP/SAML2.php2
-rw-r--r--modules/saml/lib/SP/LogoutStore.php2
-rw-r--r--modules/saml/www/sp/saml2-acs.php2
-rw-r--r--modules/statistics/www/showstats.php2
-rw-r--r--www/auth/login-admin.php2
-rw-r--r--www/auth/login-cas-ldap.php2
-rw-r--r--www/auth/login-ldapmulti.php2
-rw-r--r--www/auth/login-radius.php2
-rw-r--r--www/auth/login-tlsclient.php2
-rw-r--r--www/auth/login-wayf-ldap.php2
-rw-r--r--www/auth/login.php2
-rw-r--r--www/authmemcookie.php2
-rw-r--r--www/errorreport.php2
-rw-r--r--www/example-simple/attributequery.php2
-rw-r--r--www/example-simple/hostnames.php2
-rw-r--r--www/example-simple/saml2-example.php2
-rw-r--r--www/example-simple/shib13-example.php2
-rw-r--r--www/example-simple/wsfed-example.php2
-rw-r--r--www/saml2/sp/AssertionConsumerService.php2
-rw-r--r--www/saml2/sp/SingleLogoutService.php2
-rw-r--r--www/saml2/sp/initSLO.php2
-rw-r--r--www/saml2/sp/initSSO.php2
-rw-r--r--www/shib13/sp/AssertionConsumerService.php2
-rw-r--r--www/shib13/sp/initSSO.php2
-rw-r--r--www/wsfed/sp/initSLO.php2
-rw-r--r--www/wsfed/sp/prp.php2
64 files changed, 100 insertions, 91 deletions
diff --git a/bin/pack.php b/bin/pack.php
index f69cafb..3328cf2 100755
--- a/bin/pack.php
+++ b/bin/pack.php
@@ -12,7 +12,7 @@ if (count($argv) < 1) {
}
// Needed in order to make session_start to be called before output is printed.
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$config = SimpleSAML_Configuration::getConfig('config.php');
diff --git a/docs/simplesamlphp-sp-migration.txt b/docs/simplesamlphp-sp-migration.txt
index 7b425e0..0e4481b 100644
--- a/docs/simplesamlphp-sp-migration.txt
+++ b/docs/simplesamlphp-sp-migration.txt
@@ -155,7 +155,7 @@ This is a quick overview of the API:
Generally, if you have:
$config = SimpleSAML_Configuration::getInstance();
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
you should replace it with this single line:
diff --git a/lib/SimpleSAML/Auth/BWC.php b/lib/SimpleSAML/Auth/BWC.php
index 3cdddf5..f66203f 100644
--- a/lib/SimpleSAML/Auth/BWC.php
+++ b/lib/SimpleSAML/Auth/BWC.php
@@ -101,7 +101,7 @@ class SimpleSAML_Auth_BWC extends SimpleSAML_Auth_Simple {
$params['ReturnTo'] = SimpleSAML_Utilities::createPostRedirectLink($params['ReturnTo'], $_POST);
}
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$authnRequest = array(
'IsPassive' => isset($params['isPassive']) ? $params['isPassive'] : FALSE,
@@ -152,7 +152,7 @@ class SimpleSAML_Auth_BWC extends SimpleSAML_Auth_Simple {
$url = SimpleSAML_Utilities::selfURL();
}
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
if (!$session->isValid($this->authority)) {
/* Not authenticated to this authentication source. */
SimpleSAML_Utilities::redirectTrustedURL($url);
diff --git a/lib/SimpleSAML/Auth/Default.php b/lib/SimpleSAML/Auth/Default.php
index ca02e74..90d3d08 100644
--- a/lib/SimpleSAML/Auth/Default.php
+++ b/lib/SimpleSAML/Auth/Default.php
@@ -124,7 +124,7 @@ class SimpleSAML_Auth_Default {
$return = $state['SimpleSAML_Auth_Default.Return'];
/* Save session state. */
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->doLogin($state['SimpleSAML_Auth_Default.id'], self::extractPersistentAuthState($state));
if (is_string($return)) {
@@ -155,7 +155,7 @@ class SimpleSAML_Auth_Default {
assert('is_string($returnURL)');
assert('is_string($authority) || is_null($authority)');
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
if ($authority === NULL) {
$authority = $session->getAuthority();
@@ -235,7 +235,7 @@ class SimpleSAML_Auth_Default {
$source = $state['SimpleSAML_Auth_Default.logoutSource'];
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$authId = $session->getAuthority();
if ($authId !== $source) {
@@ -270,7 +270,7 @@ class SimpleSAML_Auth_Default {
assert('is_string($authId)');
assert('is_string($redirectTo)');
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->doLogin($authId, self::extractPersistentAuthState($state));
SimpleSAML_Utilities::redirectUntrustedURL($redirectTo);
diff --git a/lib/SimpleSAML/Auth/Simple.php b/lib/SimpleSAML/Auth/Simple.php
index 8043830..db14112 100644
--- a/lib/SimpleSAML/Auth/Simple.php
+++ b/lib/SimpleSAML/Auth/Simple.php
@@ -48,7 +48,7 @@ class SimpleSAML_Auth_Simple {
* @return bool TRUE if the user is authenticated, FALSE if not.
*/
public function isAuthenticated() {
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
return $session->isValid($this->authSource);
}
@@ -70,7 +70,7 @@ class SimpleSAML_Auth_Simple {
*/
public function requireAuth(array $params = array()) {
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
if ($session->isValid($this->authSource)) {
/* Already authenticated. */
@@ -176,7 +176,7 @@ class SimpleSAML_Auth_Simple {
assert('isset($params["ReturnStateParam"]) && isset($params["ReturnStateStage"])');
}
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
if ($session->isValid($this->authSource)) {
$state = $session->getAuthData($this->authSource, 'LogoutState');
if ($state !== NULL) {
@@ -241,7 +241,7 @@ class SimpleSAML_Auth_Simple {
}
/* Authenticated. */
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
return $session->getAuthData($this->authSource, 'Attributes');
}
@@ -259,7 +259,7 @@ class SimpleSAML_Auth_Simple {
return NULL;
}
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
return $session->getAuthData($this->authSource, $name);
}
@@ -275,7 +275,7 @@ class SimpleSAML_Auth_Simple {
return NULL;
}
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
return $session->getAuthState($this->authSource);
}
diff --git a/lib/SimpleSAML/Auth/Source.php b/lib/SimpleSAML/Auth/Source.php
index 802035e..29effde 100644
--- a/lib/SimpleSAML/Auth/Source.php
+++ b/lib/SimpleSAML/Auth/Source.php
@@ -111,7 +111,7 @@ abstract class SimpleSAML_Auth_Source {
assert('isset($state["ReturnCallback"])');
/* The default implementation just copies over the previous authentication data. */
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$data = $session->getAuthState($this->authId);
foreach ($data as $k => $v) {
$state[$k] = $v;
@@ -294,7 +294,7 @@ abstract class SimpleSAML_Auth_Source {
);
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('SimpleSAML_Auth_Source.LogoutCallbacks', $id, $data,
SimpleSAML_Session::DATA_TIMEOUT_LOGOUT);
}
@@ -315,7 +315,7 @@ abstract class SimpleSAML_Auth_Source {
$id = strlen($this->authId) . ':' . $this->authId . $assoc;
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$data = $session->getData('SimpleSAML_Auth_Source.LogoutCallbacks', $id);
if ($data === NULL) {
diff --git a/lib/SimpleSAML/Auth/State.php b/lib/SimpleSAML/Auth/State.php
index ccea15f..a8600b1 100644
--- a/lib/SimpleSAML/Auth/State.php
+++ b/lib/SimpleSAML/Auth/State.php
@@ -160,7 +160,7 @@ class SimpleSAML_Auth_State {
/* Save state. */
$serializedState = serialize($state);
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('SimpleSAML_Auth_State', $id, $serializedState, self::getStateTimeout());
SimpleSAML_Logger::debug('Saved state: ' . var_export($return, TRUE));
@@ -213,7 +213,7 @@ class SimpleSAML_Auth_State {
$sid = SimpleSAML_Utilities::parseStateID($id);
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$state = $session->getData('SimpleSAML_Auth_State', $sid['id']);
if ($state === NULL) {
@@ -274,7 +274,7 @@ class SimpleSAML_Auth_State {
SimpleSAML_Logger::debug('Deleting state: ' . var_export($state[self::ID], TRUE));
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->deleteData('SimpleSAML_Auth_State', $state[self::ID]);
}
diff --git a/lib/SimpleSAML/Error/Error.php b/lib/SimpleSAML/Error/Error.php
index ff18708..67cf293 100644
--- a/lib/SimpleSAML/Error/Error.php
+++ b/lib/SimpleSAML/Error/Error.php
@@ -207,7 +207,7 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception {
SimpleSAML_Logger::error('Error report with id ' . $reportId . ' generated.');
$config = SimpleSAML_Configuration::getInstance();
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
if (isset($_SERVER['HTTP_REFERER'])) {
$referer = $_SERVER['HTTP_REFERER'];
@@ -270,7 +270,7 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception {
$data['errorReportAddress'] = $baseurl . 'errorreport.php';
}
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$attributes = $session->getAttributes();
if (is_array($attributes) && array_key_exists('mail', $attributes) && count($attributes['mail']) > 0) {
$data['email'] = $attributes['mail'][0];
diff --git a/lib/SimpleSAML/IdP.php b/lib/SimpleSAML/IdP.php
index 119231a..130a6ec 100644
--- a/lib/SimpleSAML/IdP.php
+++ b/lib/SimpleSAML/IdP.php
@@ -211,7 +211,7 @@ class SimpleSAML_IdP {
$association['core:IdP'] = $this->id;
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->addAssociation($this->associationGroup, $association);
}
@@ -223,7 +223,7 @@ class SimpleSAML_IdP {
*/
public function getAssociations() {
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
return $session->getAssociations($this->associationGroup);
}
@@ -236,7 +236,7 @@ class SimpleSAML_IdP {
public function terminateAssociation($assocId) {
assert('is_string($assocId)');
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->terminateAssociation($this->associationGroup, $assocId);
}
@@ -260,7 +260,7 @@ class SimpleSAML_IdP {
assert('is_callable($state["Responder"])');
if (isset($state['core:SP'])) {
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('core:idp-ssotime', $state['core:IdP'] . ';' . $state['core:SP'],
time(), SimpleSAML_Session::DATA_TIMEOUT_LOGOUT);
}
@@ -292,7 +292,7 @@ class SimpleSAML_IdP {
}
if (isset($state['core:SP'])) {
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$previousSSOTime = $session->getData('core:idp-ssotime', $state['core:IdP'] . ';' . $state['core:SP']);
if ($previousSSOTime !== NULL) {
$state['PreviousSSOTimestamp'] = $previousSSOTime;
diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php
index 71a175a..40c7980 100644
--- a/lib/SimpleSAML/Logger.php
+++ b/lib/SimpleSAML/Logger.php
@@ -303,7 +303,7 @@ class SimpleSAML_Logger
self::$trackid = self::$TRACKID_FETCHING;
// get the current session. This could cause recursion back to the logger class
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
// update the track ID
self::$trackid = $session->getTrackID();
diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index 468bddf..a20b1a2 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -191,14 +191,23 @@ class SimpleSAML_Session {
}
- /**
+ /**
+ * @deprecated
+ * @see SimpleSAML_Session::getSessionFromRequest()
+ */
+ public static function getInstance() {
+ return self::getSessionFromRequest();
+ }
+
+
+ /**
* Retrieves the current session. Will create a new session if there isn't a session.
*
* @return SimpleSAML_Session The current session.
* @throws Exception When session couldn't be initialized and
* the session fallback is disabled by configuration.
*/
- public static function getInstance() {
+ public static function getSessionFromRequest() {
/* Check if we already have initialized the session. */
if (isset(self::$instance)) {
diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index 1892568..4ab3dc1 100644
--- a/lib/SimpleSAML/Utilities.php
+++ b/lib/SimpleSAML/Utilities.php
@@ -1622,7 +1622,7 @@ class SimpleSAML_Utilities {
*/
public static function isAdmin() {
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
return $session->isValid('admin') || $session->isValid('login-admin');
}
@@ -1726,7 +1726,7 @@ class SimpleSAML_Utilities {
'url' => $destination,
);
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('core_postdatalink', $postId, $postData);
$url = SimpleSAML_Module::getModuleURL('core/postredirect.php', array('RedirId' => $postId));
@@ -1753,7 +1753,7 @@ class SimpleSAML_Utilities {
'url' => $destination,
);
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('core_postdatalink', $postId, $postData);
$redirInfo = base64_encode(self::aesEncrypt($session->getSessionId() . ':' . $postId));
@@ -2105,7 +2105,7 @@ class SimpleSAML_Utilities {
public static function checkCookie($retryURL = NULL) {
assert('is_string($retryURL) || is_null($retryURL)');
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
if ($session->hasSessionCookie()) {
return;
}
diff --git a/lib/SimpleSAML/XHTML/IdPDisco.php b/lib/SimpleSAML/XHTML/IdPDisco.php
index 7e7eeb9..2e06cdd 100644
--- a/lib/SimpleSAML/XHTML/IdPDisco.php
+++ b/lib/SimpleSAML/XHTML/IdPDisco.php
@@ -98,7 +98,7 @@ class SimpleSAML_XHTML_IdPDisco {
/* Initialize standard classes. */
$this->config = SimpleSAML_Configuration::getInstance();
$this->metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
- $this->session = SimpleSAML_Session::getInstance();
+ $this->session = SimpleSAML_Session::getSessionFromRequest();
$this->instance = $instance;
$this->metadataSets = $metadataSets;
diff --git a/modules/InfoCard/www/getcardform.php b/modules/InfoCard/www/getcardform.php
index c4dd9af..76f4690 100644
--- a/modules/InfoCard/www/getcardform.php
+++ b/modules/InfoCard/www/getcardform.php
@@ -19,7 +19,7 @@ $Infocard = $autoconfig->getValue('InfoCard');
/* Load the session of the current user. */
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
if (!array_key_exists('AuthState', $_REQUEST)) {
SimpleSAML_Logger::debug('NO AUTH STATE');
diff --git a/modules/InfoCard/www/login-infocard.php b/modules/InfoCard/www/login-infocard.php
index 9d0ae3b..97a399b 100644
--- a/modules/InfoCard/www/login-infocard.php
+++ b/modules/InfoCard/www/login-infocard.php
@@ -26,7 +26,7 @@ $contact_info_URL = $autoconfig->getValue('contact_info_URL');
/* Load the session of the current user. */
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
if (!array_key_exists('AuthState', $_REQUEST)) {
diff --git a/modules/core/lib/Auth/Process/ExtendIdPSession.php b/modules/core/lib/Auth/Process/ExtendIdPSession.php
index 8461681..7a6df57 100644
--- a/modules/core/lib/Auth/Process/ExtendIdPSession.php
+++ b/modules/core/lib/Auth/Process/ExtendIdPSession.php
@@ -24,7 +24,7 @@ class sspmod_core_Auth_Process_ExtendIdPSession extends SimpleSAML_Auth_Processi
}
/* Update authority expire time */
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setAuthorityExpire($state['Authority']);
/* Update session cookies duration */
diff --git a/modules/core/www/bwc_resumeauth.php b/modules/core/www/bwc_resumeauth.php
index df93707..c704ed2 100644
--- a/modules/core/www/bwc_resumeauth.php
+++ b/modules/core/www/bwc_resumeauth.php
@@ -5,7 +5,7 @@ if (!isset($_REQUEST['RequestID'])) {
}
/* Backwards-compatibility with old authentication pages. */
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$requestcache = $session->getAuthnRequest('saml2', (string)$_REQUEST['RequestID']);
if (!$requestcache) {
throw new Exception('Could not retrieve cached RequestID = ' . $authId);
diff --git a/modules/core/www/frontpage_auth.php b/modules/core/www/frontpage_auth.php
index 6ba33d1..28d4530 100644
--- a/modules/core/www/frontpage_auth.php
+++ b/modules/core/www/frontpage_auth.php
@@ -3,7 +3,7 @@
/* Load simpleSAMLphp, configuration */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
/* Check if valid local session exists.. */
if ($config->getBoolean('admin.protectindexpage', false)) {
diff --git a/modules/core/www/frontpage_config.php b/modules/core/www/frontpage_config.php
index f4bb8f5..c911f90 100644
--- a/modules/core/www/frontpage_config.php
+++ b/modules/core/www/frontpage_config.php
@@ -4,7 +4,7 @@
/* Load simpleSAMLphp, configuration */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
/* Check if valid local session exists.. */
if ($config->getBoolean('admin.protectindexpage', false)) {
diff --git a/modules/core/www/frontpage_federation.php b/modules/core/www/frontpage_federation.php
index 072ad6c..d502e7b 100644
--- a/modules/core/www/frontpage_federation.php
+++ b/modules/core/www/frontpage_federation.php
@@ -4,7 +4,7 @@
/* Load simpleSAMLphp, configuration */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
/* Check if valid local session exists.. */
if ($config->getBoolean('admin.protectindexpage', false)) {
diff --git a/modules/core/www/frontpage_welcome.php b/modules/core/www/frontpage_welcome.php
index fa08477..281237a 100644
--- a/modules/core/www/frontpage_welcome.php
+++ b/modules/core/www/frontpage_welcome.php
@@ -3,7 +3,7 @@
/* Load simpleSAMLphp, configuration */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
/* Check if valid local session exists.. */
if ($config->getBoolean('admin.protectindexpage', false)) {
diff --git a/modules/core/www/idp/resumeauth.php b/modules/core/www/idp/resumeauth.php
index b9e24fe..dff0cb3 100644
--- a/modules/core/www/idp/resumeauth.php
+++ b/modules/core/www/idp/resumeauth.php
@@ -7,7 +7,7 @@ if (!isset($_REQUEST['RequestID'])) {
}
/* Backwards-compatibility with old authentication pages. */
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$requestcache = $session->getAuthnRequest('saml2', (string)$_REQUEST['RequestID']);
if (!$requestcache) {
throw new Exception('Could not retrieve cached RequestID = ' . $authId);
diff --git a/modules/core/www/postredirect.php b/modules/core/www/postredirect.php
index fd9bef4..d414050 100644
--- a/modules/core/www/postredirect.php
+++ b/modules/core/www/postredirect.php
@@ -9,7 +9,7 @@
if (array_key_exists('RedirId', $_REQUEST)) {
$postId = $_REQUEST['RedirId'];
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
} elseif (array_key_exists('RedirInfo', $_REQUEST)) {
$encData = base64_decode($_REQUEST['RedirInfo']);
diff --git a/modules/core/www/show_metadata.php b/modules/core/www/show_metadata.php
index e7647d2..b2e9d96 100644
--- a/modules/core/www/show_metadata.php
+++ b/modules/core/www/show_metadata.php
@@ -4,7 +4,7 @@
/* Load simpleSAMLphp, configuration */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Utilities::requireAdmin();
diff --git a/modules/cron/www/croninfo.php b/modules/cron/www/croninfo.php
index 0e55715..a0ecd68 100644
--- a/modules/cron/www/croninfo.php
+++ b/modules/cron/www/croninfo.php
@@ -9,7 +9,7 @@ require_once('_include.php');
/* Load simpleSAMLphp, configuration and metadata */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Utilities::requireAdmin();
diff --git a/modules/logpeek/www/index.php b/modules/logpeek/www/index.php
index 2389e31..3ae3e70 100644
--- a/modules/logpeek/www/index.php
+++ b/modules/logpeek/www/index.php
@@ -19,7 +19,7 @@ function logFilter($objFile, $tag, $cut){
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Utilities::requireAdmin();
diff --git a/modules/metaedit/www/xmlimport.php b/modules/metaedit/www/xmlimport.php
index 12f6072..12799af 100644
--- a/modules/metaedit/www/xmlimport.php
+++ b/modules/metaedit/www/xmlimport.php
@@ -3,7 +3,7 @@
/* Load simpleSAMLphp, configuration and metadata */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$template = new SimpleSAML_XHTML_Template($config, 'metaedit:xmlimport.tpl.php');
$template->show();
diff --git a/modules/multiauth/lib/Auth/Source/MultiAuth.php b/modules/multiauth/lib/Auth/Source/MultiAuth.php
index ea74df5..1bac37a 100644
--- a/modules/multiauth/lib/Auth/Source/MultiAuth.php
+++ b/modules/multiauth/lib/Auth/Source/MultiAuth.php
@@ -149,7 +149,7 @@ class sspmod_multiauth_Auth_Source_MultiAuth extends SimpleSAML_Auth_Source {
}
/* Save the selected authentication source for the logout process. */
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setData(self::SESSION_SOURCE, $state[self::AUTHID], $authId);
try {
@@ -175,7 +175,7 @@ class sspmod_multiauth_Auth_Source_MultiAuth extends SimpleSAML_Auth_Source {
assert('is_array($state)');
/* Get the source that was used to authenticate */
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$authId = $session->getData(self::SESSION_SOURCE, $this->authId);
$source = SimpleSAML_Auth_Source::getById($authId);
diff --git a/modules/negotiate/lib/Auth/Source/Negotiate.php b/modules/negotiate/lib/Auth/Source/Negotiate.php
index 173114c..7689186 100644
--- a/modules/negotiate/lib/Auth/Source/Negotiate.php
+++ b/modules/negotiate/lib/Auth/Source/Negotiate.php
@@ -80,7 +80,7 @@ class sspmod_negotiate_Auth_Source_Negotiate extends SimpleSAML_Auth_Source {
$this->fallBack($state);
// Go straight to fallback if Negotiate is disabled or if you are
// sent back to the IdP directly from the SP after having logged out
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$disabled = $session->getData('negotiate:disable', 'session');
if ($disabled or
@@ -309,7 +309,7 @@ click <a href="'.htmlspecialchars($url).'">here</a>.
SimpleSAML_Logger::debug('Negotiate - logout has the following authId: "'.$authId.'"');
if ($authId === NULL) {
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('negotiate:disable', 'session', TRUE, 24*60*60);
parent::logout($state);
} else {
diff --git a/modules/negotiate/www/disable.php b/modules/negotiate/www/disable.php
index ca8bb8d..42b09c0 100644
--- a/modules/negotiate/www/disable.php
+++ b/modules/negotiate/www/disable.php
@@ -17,7 +17,7 @@ $params = array(
SimpleSAML_Utilities::setCookie('NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT', 'True', $params, FALSE);
$globalConfig = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('negotiate:disable', 'session', FALSE, 24*60*60);
$t = new SimpleSAML_XHTML_Template($globalConfig, 'negotiate:disable.php');
$t->show();
diff --git a/modules/negotiate/www/enable.php b/modules/negotiate/www/enable.php
index e28bde1..1bf30f2 100644
--- a/modules/negotiate/www/enable.php
+++ b/modules/negotiate/www/enable.php
@@ -16,7 +16,7 @@ $params = array(
SimpleSAML_Utilities::setCookie('NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT', NULL, $params, FALSE);
$globalConfig = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('negotiate:disable', 'session', FALSE, 24*60*60);
$t = new SimpleSAML_XHTML_Template($globalConfig, 'negotiate:enable.php');
$t->show();
diff --git a/modules/negotiate/www/retry.php b/modules/negotiate/www/retry.php
index 1f75c61..b36290e 100644
--- a/modules/negotiate/www/retry.php
+++ b/modules/negotiate/www/retry.php
@@ -28,7 +28,7 @@ if (isset($idpmeta['auth'])) {
if ($source === NULL)
throw new SimpleSAML_Error_BadRequest('Invalid AuthId "' . $idpmeta['auth'] . '" - not found.');
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('negotiate:disable', 'session', FALSE, 24*60*60);
SimpleSAML_Logger::debug('Negotiate(retry) - session enabled, retrying.');
$source->authenticate($state);
diff --git a/modules/oauth/bin/demo.php b/modules/oauth/bin/demo.php
index 49ebad8..b1dcf52 100755
--- a/modules/oauth/bin/demo.php
+++ b/modules/oauth/bin/demo.php
@@ -20,7 +20,7 @@ try {
require_once(dirname(dirname(__FILE__)) . '/libextinc/OAuth.php');
// Needed in order to make session_start to be called before output is printed.
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
//$baseurl = (isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 'https://foodle.feide.no/simplesaml');
$baseurl = (isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 'http://mars.foodle.local/simplesaml');
diff --git a/modules/oauth/www/authorize.php b/modules/oauth/www/authorize.php
index 583c86e..ed92f14 100644
--- a/modules/oauth/www/authorize.php
+++ b/modules/oauth/www/authorize.php
@@ -26,7 +26,7 @@ try {
$config = SimpleSAML_Configuration::getInstance();
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$as = $oauthconfig->getString('auth');
if (!$session->isValid($as)) {
diff --git a/modules/oauth/www/registry.edit.php b/modules/oauth/www/registry.edit.php
index f4a5ea3..972e104 100644
--- a/modules/oauth/www/registry.edit.php
+++ b/modules/oauth/www/registry.edit.php
@@ -2,7 +2,7 @@
/* Load simpleSAMLphp, configuration and metadata */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php');
$store = new sspmod_core_Storage_SQLPermanentStorage('oauth');
diff --git a/modules/oauth/www/registry.php b/modules/oauth/www/registry.php
index d562bb0..c7ac52c 100644
--- a/modules/oauth/www/registry.php
+++ b/modules/oauth/www/registry.php
@@ -2,7 +2,7 @@
/* Load simpleSAMLphp, configuration and metadata */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php');
$store = new sspmod_core_Storage_SQLPermanentStorage('oauth');
diff --git a/modules/openid/lib/SessionStore.php b/modules/openid/lib/SessionStore.php
index a084d09..2dc31a5 100644
--- a/modules/openid/lib/SessionStore.php
+++ b/modules/openid/lib/SessionStore.php
@@ -20,7 +20,7 @@ class sspmod_openid_SessionStore {
public function get($key) {
assert('is_string($key)');
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
return $session->getData('openid.session', $key);
}
@@ -34,7 +34,7 @@ class sspmod_openid_SessionStore {
public function set($key, $value) {
assert('is_string($key)');
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->setData('openid.session', $key, $value);
}
@@ -47,7 +47,7 @@ class sspmod_openid_SessionStore {
public function del($key) {
assert('is_string($key)');
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->deleteData('openid.session', $key);
}
diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php
index a23cb0f..565ad66 100644
--- a/modules/saml/lib/Auth/Source/SP.php
+++ b/modules/saml/lib/Auth/Source/SP.php
@@ -403,7 +403,7 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
public function reauthenticate(array &$state) {
assert('is_array($state)');
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$data = $session->getAuthState($this->authId);
foreach ($data as $k => $v) {
$state[$k] = $v;
@@ -438,7 +438,7 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
assert('isset($state["ReturnCallback"])');
// Update session state
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->doLogin($state['saml:sp:AuthId'], SimpleSAML_Auth_Default::extractPersistentAuthState($state));
// resume the login process
diff --git a/modules/saml/lib/IdP/SAML2.php b/modules/saml/lib/IdP/SAML2.php
index f7b45d1..0557290 100644
--- a/modules/saml/lib/IdP/SAML2.php
+++ b/modules/saml/lib/IdP/SAML2.php
@@ -798,7 +798,7 @@ class sspmod_saml_IdP_SAML2 {
$a->setAuthnInstant($state['AuthnInstant']);
} else {
/* For backwards compatibility. Remove in version 1.8. */
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$a->setAuthnInstant($session->getAuthnInstant());
}
diff --git a/modules/saml/lib/SP/LogoutStore.php b/modules/saml/lib/SP/LogoutStore.php
index 93bef89..6ad352f 100644
--- a/modules/saml/lib/SP/LogoutStore.php
+++ b/modules/saml/lib/SP/LogoutStore.php
@@ -187,7 +187,7 @@ class sspmod_saml_SP_LogoutStore {
$sessionIndex = sha1($sessionIndex);
}
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$sessionId = $session->getSessionId();
if ($store instanceof SimpleSAML_Store_SQL) {
diff --git a/modules/saml/www/sp/saml2-acs.php b/modules/saml/www/sp/saml2-acs.php
index dc03758..1341095 100644
--- a/modules/saml/www/sp/saml2-acs.php
+++ b/modules/saml/www/sp/saml2-acs.php
@@ -34,7 +34,7 @@ if ($idp === NULL) {
}
}
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$prevAuth = $session->getAuthData($sourceId, 'saml:sp:prevAuth');
if ($prevAuth !== NULL && $prevAuth['id'] === $response->getId() && $prevAuth['issuer'] === $idp) {
/* OK, it looks like this message has the same issuer
diff --git a/modules/statistics/www/showstats.php b/modules/statistics/www/showstats.php
index babdcf2..0af0e9d 100644
--- a/modules/statistics/www/showstats.php
+++ b/modules/statistics/www/showstats.php
@@ -2,7 +2,7 @@
$config = SimpleSAML_Configuration::getInstance();
$statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php');
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
sspmod_statistics_AccessCheck::checkAccess($statconfig);
diff --git a/www/auth/login-admin.php b/www/auth/login-admin.php
index 306dda0..5a53b83 100644
--- a/www/auth/login-admin.php
+++ b/www/auth/login-admin.php
@@ -12,7 +12,7 @@ require_once('../_include.php');
$config = SimpleSAML_Configuration::getInstance();
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file auth/login-admin.php is deprecated and will be removed in future versions.');
diff --git a/www/auth/login-cas-ldap.php b/www/auth/login-cas-ldap.php
index 7a7325d..3a6b835 100644
--- a/www/auth/login-cas-ldap.php
+++ b/www/auth/login-cas-ldap.php
@@ -22,7 +22,7 @@
require_once('../_include.php');
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file auth/login-cas-ldap.php is deprecated and will be removed in future versions.');
diff --git a/www/auth/login-ldapmulti.php b/www/auth/login-ldapmulti.php
index 4db2fdb..9364aef 100644
--- a/www/auth/login-ldapmulti.php
+++ b/www/auth/login-ldapmulti.php
@@ -12,7 +12,7 @@ require_once('../_include.php');
$config = SimpleSAML_Configuration::getInstance();
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file auth/login-ldapmulti.php is deprecated and will be removed in future versions.');
diff --git a/www/auth/login-radius.php b/www/auth/login-radius.php
index d8d785b..cec122a 100644
--- a/www/auth/login-radius.php
+++ b/www/auth/login-radius.php
@@ -12,7 +12,7 @@ require_once('../_include.php');
$config = SimpleSAML_Configuration::getInstance();
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file auth/login-radius.php is deprecated and will be removed in future versions.');
diff --git a/www/auth/login-tlsclient.php b/www/auth/login-tlsclient.php
index 71930ef..414f4d5 100644
--- a/www/auth/login-tlsclient.php
+++ b/www/auth/login-tlsclient.php
@@ -12,7 +12,7 @@ require_once('../_include.php');
$config = SimpleSAML_Configuration::getInstance();
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file auth/login-tlsclient.php is deprecated and will be removed in future versions.');
diff --git a/www/auth/login-wayf-ldap.php b/www/auth/login-wayf-ldap.php
index c0ad0a9..a1539c5 100644
--- a/www/auth/login-wayf-ldap.php
+++ b/www/auth/login-wayf-ldap.php
@@ -22,7 +22,7 @@
require_once('../_include.php');
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file auth/login-wayf-ldap.php is deprecated and will be removed in future versions.');
diff --git a/www/auth/login.php b/www/auth/login.php
index d334fbf..d0b0fdd 100644
--- a/www/auth/login.php
+++ b/www/auth/login.php
@@ -12,7 +12,7 @@ require_once('../_include.php');
$config = SimpleSAML_Configuration::getInstance();
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file auth/login.php is deprecated and will be removed in future versions.');
diff --git a/www/authmemcookie.php b/www/authmemcookie.php
index a4e877a..b385400 100644
--- a/www/authmemcookie.php
+++ b/www/authmemcookie.php
@@ -105,7 +105,7 @@ try {
$memcache->set($sessionID, $data, 0, $expirationTime);
/* Register logout handler. */
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$session->registerLogoutHandler('SimpleSAML_AuthMemCookie', 'logoutHandler');
/* Redirect the user back to this page to signal that the login is completed. */
diff --git a/www/errorreport.php b/www/errorreport.php
index 0abb624..3ce5246 100644
--- a/www/errorreport.php
+++ b/www/errorreport.php
@@ -18,7 +18,7 @@ $email = (string)$_REQUEST['email'];
$text = htmlspecialchars((string)$_REQUEST['text']);
try {
- $session = SimpleSAML_Session::getInstance();
+ $session = SimpleSAML_Session::getSessionFromRequest();
$data = $session->getData('core:errorreport', $reportId);
} catch (Exception $e) {
SimpleSAML_Logger::error('Error loading error report data: ' . var_export($e->getMessage(), TRUE));
diff --git a/www/example-simple/attributequery.php b/www/example-simple/attributequery.php
index 890a1e4..76932ba 100644
--- a/www/example-simple/attributequery.php
+++ b/www/example-simple/attributequery.php
@@ -10,7 +10,7 @@
require_once('../_include.php');
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
SimpleSAML_Logger::warning('The file example-simple/attributequery.php is deprecated and will be removed in future versions.');
diff --git a/www/example-simple/hostnames.php b/www/example-simple/hostnames.php
index 87e5ca4..e92e26d 100644
--- a/www/example-simple/hostnames.php
+++ b/www/example-simple/hostnames.php
@@ -4,7 +4,7 @@ require_once('../_include.php');
/* Load simpleSAMLphp, configuration */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
/* Check if valid local session exists.. */
SimpleSAML_Utilities::requireAdmin();
diff --git a/www/example-simple/saml2-example.php b/www/example-simple/saml2-example.php
index 7c48d5f..5fdc83b 100644
--- a/www/example-simple/saml2-example.php
+++ b/www/example-simple/saml2-example.php
@@ -27,7 +27,7 @@ session_cache_limiter('nocache');
/* Load simpleSAMLphp, configuration and metadata */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file example-simple/saml2-example.php is deprecated and will be removed in future versions.');
diff --git a/www/example-simple/shib13-example.php b/www/example-simple/shib13-example.php
index 96d78b3..4b275ed 100644
--- a/www/example-simple/shib13-example.php
+++ b/www/example-simple/shib13-example.php
@@ -27,7 +27,7 @@ session_cache_limiter('nocache');
/* Load simpleSAMLphp, configuration and metadata */
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file example-simple/shib13-example.php is deprecated and will be removed in future versions.');
diff --git a/www/example-simple/wsfed-example.php b/www/example-simple/wsfed-example.php
index 5335d0d..166fc61 100644
--- a/www/example-simple/wsfed-example.php
+++ b/www/example-simple/wsfed-example.php
@@ -11,7 +11,7 @@
require_once('../_include.php');
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file example-simple/wsfed-example.php is deprecated and will be removed in future versions.');
diff --git a/www/saml2/sp/AssertionConsumerService.php b/www/saml2/sp/AssertionConsumerService.php
index 88dbc5c..5c0a8e1 100644
--- a/www/saml2/sp/AssertionConsumerService.php
+++ b/www/saml2/sp/AssertionConsumerService.php
@@ -27,7 +27,7 @@ SimpleSAML_Logger::warning('The file saml2/sp/AssertionConsumerService.php is de
/* Get the session object for the user. Create a new session if no session
* exists for this user.
*/
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
/**
diff --git a/www/saml2/sp/SingleLogoutService.php b/www/saml2/sp/SingleLogoutService.php
index e0b6f8a..e21b65c 100644
--- a/www/saml2/sp/SingleLogoutService.php
+++ b/www/saml2/sp/SingleLogoutService.php
@@ -16,7 +16,7 @@ $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
SimpleSAML_Logger::warning('The file saml2/sp/SingleLogoutService.php is deprecated and will be removed in future versions.');
// Get the local session
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::info('SAML2.0 - SP.SingleLogoutService: Accessing SAML 2.0 SP endpoint SingleLogoutService');
diff --git a/www/saml2/sp/initSLO.php b/www/saml2/sp/initSLO.php
index de4f381..50b2d03 100644
--- a/www/saml2/sp/initSLO.php
+++ b/www/saml2/sp/initSLO.php
@@ -12,7 +12,7 @@ require_once('../../_include.php');
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file saml2/sp/initSLO.php is deprecated and will be removed in future versions.');
diff --git a/www/saml2/sp/initSSO.php b/www/saml2/sp/initSSO.php
index 55ca0ef..ef1acc2 100644
--- a/www/saml2/sp/initSSO.php
+++ b/www/saml2/sp/initSSO.php
@@ -12,7 +12,7 @@ require_once('../../_include.php');
$config = SimpleSAML_Configuration::getInstance();
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::warning('The file saml2/sp/initSSO.php is deprecated and will be removed in future versions.');
diff --git a/www/shib13/sp/AssertionConsumerService.php b/www/shib13/sp/AssertionConsumerService.php
index 9e59d0a..ab1fd68 100644
--- a/www/shib13/sp/AssertionConsumerService.php
+++ b/www/shib13/sp/AssertionConsumerService.php
@@ -14,7 +14,7 @@ $config = SimpleSAML_Configuration::getInstance();
SimpleSAML_Logger::warning('The file shib13/sp/AssertionConsumerService.php is deprecated and will be removed in future versions.');
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
/**
diff --git a/www/shib13/sp/initSSO.php b/www/shib13/sp/initSSO.php
index de5f74e..2cceb21 100644
--- a/www/shib13/sp/initSSO.php
+++ b/www/shib13/sp/initSSO.php
@@ -15,7 +15,7 @@ $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
SimpleSAML_Logger::warning('The file shib13/sp/initSSO.php is deprecated and will be removed in future versions.');
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
/*
diff --git a/www/wsfed/sp/initSLO.php b/www/wsfed/sp/initSLO.php
index 001d8fb..a30e294 100644
--- a/www/wsfed/sp/initSLO.php
+++ b/www/wsfed/sp/initSLO.php
@@ -14,7 +14,7 @@ $config = SimpleSAML_Configuration::getInstance();
SimpleSAML_Logger::warning('The file wsfed/sp/initSLO.php is deprecated and will be removed in future versions.');
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
SimpleSAML_Logger::info('WS-Fed - SP.initSLO: Accessing WS-Fed SP initSLO script');
diff --git a/www/wsfed/sp/prp.php b/www/wsfed/sp/prp.php
index 606222b..219930d 100644
--- a/www/wsfed/sp/prp.php
+++ b/www/wsfed/sp/prp.php
@@ -24,7 +24,7 @@
require_once('../../_include.php');
$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
+$session = SimpleSAML_Session::getSessionFromRequest();
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
SimpleSAML_Logger::warning('The file wsfed/sp/prp.php is deprecated and will be removed in future versions.');