mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-24 12:08:33 -04:00
Regenerate session ID on login (#7829)
Follow-up to #7762 * Regenerate session ID on login * Send only one cookie * Improvements * Delete old session file * Simplify * Make function consistent with others
This commit is contained in:
1 parent
585875cda7
commit
200eafb352
3 files changed
+21
-12
No files matched your search
@@ -152,6 +152,7 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
|
||||
);
|
||||
if ($ok) {
|
||||
// Set session parameter to give access to the user.
|
||||
Minz_Session::regenerateID('FreshRSS');
|
||||
Minz_Session::_params([
|
||||
Minz_User::CURRENT_USER => $username,
|
||||
'passwordHash' => FreshRSS_Context::userConf()->passwordHash,
|
||||
@@ -203,6 +204,7 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
|
||||
$ok = password_verify($password, $s);
|
||||
unset($password);
|
||||
if ($ok) {
|
||||
Minz_Session::regenerateID('FreshRSS');
|
||||
Minz_Session::_params([
|
||||
Minz_User::CURRENT_USER => $username,
|
||||
'passwordHash' => $s,
|
||||
@@ -243,6 +245,7 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
|
||||
)) {
|
||||
Minz_Request::setBadNotification(_t('feedback.auth.login.invalid'));
|
||||
} else {
|
||||
Minz_Session::regenerateID('FreshRSS');
|
||||
Minz_Session::_param('lastReauth', time());
|
||||
Minz_Request::forward($redirect, true);
|
||||
return;
|
||||
@@ -259,12 +262,7 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
|
||||
if (Minz_Request::isPost()) {
|
||||
invalidateHttpCache();
|
||||
FreshRSS_Auth::removeAccess();
|
||||
|
||||
ini_set('session.use_cookies', '1');
|
||||
Minz_Session::lock();
|
||||
Minz_Session::regenerateID();
|
||||
Minz_Session::unlock();
|
||||
|
||||
Minz_Session::regenerateID('FreshRSS');
|
||||
Minz_Request::good(_t('feedback.auth.logout.success'), [ 'c' => 'index', 'a' => 'index' ]);
|
||||
} else {
|
||||
Minz_Error::error(403);
|
||||
|
||||
Reference in new issue
Block a user