Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cookie issues with default user selections for project IDs #228

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.inc.php
Expand Up @@ -2004,7 +2004,7 @@
* Taken from Mantis to implement better login security, and solve
* TICKET 4342
*/
$tlCfg->auth_cookie = "TESTLINK_USER_AUTH_COOKIE";
$tlCfg->auth_cookie = $tlCfg->cookie->prefix . "TL_USER_AUTH_COOKIE";

/**
Used when creating a Test Suite using copy
Expand Down
2 changes: 1 addition & 1 deletion lib/functions/common.php
Expand Up @@ -209,7 +209,7 @@ function setSessionTestPlan($tplan_info) {
$ckObj = new stdClass();

$ckCfg = config_get('cookie');
$ckObj->name = $ckCfg->prefix . 'TL_lastTestPlanForUserID_' . 1;
$ckObj->name = $ckCfg->prefix . 'TL_lastTestPlanForUserID_' . $_SESSION['userID'];
$ckObj->value = $tplan_info['id'];

tlSetCookie($ckObj);
Expand Down
3 changes: 2 additions & 1 deletion lib/functions/users.inc.php
Expand Up @@ -72,7 +72,8 @@ function setUserSession(&$db,$user, $id, $roleID, $email, $locale = null, $activ
$_SESSION['testprojectID'] = $tpID;
}
// Validation is done in navBar.php
$tplan_cookie = 'TL_lastTestPlanForUserID_' . $id;
$ckCfg = config_get('cookie');
$tplan_cookie = $ckCfg->prefix . 'TL_lastTestPlanForUserID_' . $id;
if (isset($_COOKIE[$tplan_cookie]))
{
$_SESSION['testplanID'] = $_COOKIE[$tplan_cookie];
Expand Down