Skip to content

Commit 7b92caf

Browse files
authored
Merge pull request #17 from Staffbase/allow-session-parameters-as-body-parameter
Allow sending session parameters per body parameter for compatibility reasons
2 parents 458d543 + 635fb84 commit 7b92caf

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/PluginSession.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ public function __construct($pluginId, $appSecret, SessionHandlerInterface $sess
7676
session_set_save_handler($sessionHandler, true);
7777

7878

79-
$pid = isset($_GET[self::QUERY_PARAM_PID]) ? $_GET[self::QUERY_PARAM_PID] : null;
80-
$jwt = isset($_GET[self::QUERY_PARAM_JWT]) ? $_GET[self::QUERY_PARAM_JWT] : null;
81-
$sid = isset($_GET[self::QUERY_PARAM_SID]) ? $_GET[self::QUERY_PARAM_SID] : null;
79+
$pid = isset($_REQUEST[self::QUERY_PARAM_PID]) ? $_REQUEST[self::QUERY_PARAM_PID] : null;
80+
$jwt = isset($_REQUEST[self::QUERY_PARAM_JWT]) ? $_REQUEST[self::QUERY_PARAM_JWT] : null;
81+
$sid = isset($_REQUEST[self::QUERY_PARAM_SID]) ? $_REQUEST[self::QUERY_PARAM_SID] : null;
8282

8383
// lets hint to bad class usage, as these cases should never happen.
8484
if($pid && $jwt) {

test/PluginSessionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public function __construct() {
6161
*/
6262
private function setupEnvironment($queryParamPid = null, $queryParamJwt = null, $clearSession = true) {
6363

64-
$_GET[PluginSession::QUERY_PARAM_PID] = $queryParamPid;
65-
$_GET[PluginSession::QUERY_PARAM_JWT] = $queryParamJwt;
64+
$_REQUEST[PluginSession::QUERY_PARAM_PID] = $queryParamPid;
65+
$_REQUEST[PluginSession::QUERY_PARAM_JWT] = $queryParamJwt;
6666

6767
if($clearSession) {
6868
session_write_close();

0 commit comments

Comments
 (0)