Feature #10840
closedAllow "Stay logged in" from multiple browsers
Added by Adam Dingle over 12 years ago. Updated almost 8 years ago.
0%
Description
I regularly access my project's Redmine site from several different browsers on a couple of different computers. Even though I've checked "stay logged in" on all these browsers, as soon as I log into my site from any one browser I'm effectively logged out on all the others. The next time I access Redmine from a different browser, I have to log in again. This is quite inconvenient.
It would be much nicer if the autologin timeout (which I have set to 30 days) applied to every browser from which I access Redmine, independently.
Files
0001-Define-token-action-properties-explicitly.patch (7.68 KB) 0001-Define-token-action-properties-explicitly.patch | refactoring of token action handling | Gregor Schmidt, 2015-11-16 13:50 | |
0001-10840-allow-stay-logged-in-from-multiple-browsers.patch (2.19 KB) 0001-10840-allow-stay-logged-in-from-multiple-browsers.patch | simplest thing (that could possibly work) | Gregor Schmidt, 2015-11-16 13:51 | |
0001-10840-Define-token-action-properties-explicitly.patch (7.42 KB) 0001-10840-Define-token-action-properties-explicitly.patch | refactoring of token action handling (rebased onto r16138) | Gregor Schmidt, 2017-01-05 10:08 |
Related issues
Updated by Brenden Soares over 12 years ago
+1 Agreed.
"Stay logged in" is a joke a it is. Keeps making me log in within 5mins of my last login. Apparently, it's the session cookie policy that needs changing to allow for multiple sessions per user?
Updated by Etienne Massip over 12 years ago
- Category set to Accounts / authentication
Updated by Anonymous over 11 years ago
I access Redmine via Firefox, but MS Outlook loads pictures from Redmine via Internet Explorer. So if I log in from Firefox, I can't see pictures in confirmation letters.
Updated by none provided over 9 years ago
Must have for proper mobile usage where you switch 5 times a day between mobile phone, notebook and desktop PC.
Updated by Gregor Schmidt about 9 years ago
- File 0001-Define-token-action-properties-explicitly.patch 0001-Define-token-action-properties-explicitly.patch added
- File 0001-10840-allow-stay-logged-in-from-multiple-browsers.patch 0001-10840-allow-stay-logged-in-from-multiple-browsers.patch added
I have added two alternative patches, which implement this feature.
The first one (0001-10840-allow-stay-logged-in-from-multiple-browsers.patch) makes use of the features introduced in r14735. It allows 10 concurrent autologin tokens per user, updates the tests accordingly and does not change anything else.
The second one (0001-Define-token-action-properties-explicitly.patch) refactors the token class.
To ease review, I kept the original patch series which lead to the proposed solution on GitHub.
Motivation: Token actions within Redmine have a defined lifetime and a maximum number of instances per user. These are defined within the current code base (session - 1 day, 10 instances; autologin - Setting.autologin.days, 1 instance, api - does not expire, 1 instance; ...), but the configuration is not made explicitly. Instead it is spread across multiple methods within the Token class. This makes it tedious to change the properties of a certain token action and, more importantly, it makes it difficult to reuse the token class from plugin code, without the need to override Token methods. In the current code base, non-core tokens will always expire after 1 day and there may only be one token per action/user. If a plugin would need a token more similar to the session or api token, it would need to override multiple methods within app/models/token.rb to achieve the desired effect.
Approach: The refactoring adds an explicit configuration for the diffent exisiting token actions, using the properties, that are currently in use. It then changes the action related methods within the Token class, to use the configured properties instead of the hard coded approach used earlier. This way, the list of actions may be extended by plugins, without the need to change core methods.
Changes: In order to solve this issue, the proposed patch, sets the maximum number of instances of the autologin token to 10 - similar to the session tokens.
Fixes: Previously Token.destroy_expired
would delete perfectly valid autologin tokens, when Settings.autologin != "1"
. The proposed patch fixes that bug.
Updated by Gregor Schmidt about 9 years ago
As far as I can tell, #6120 is a duplicate of this issue.
Updated by Jan from Planio www.plan.io about 9 years ago
- Target version set to Candidate for next major release
As heavy plugin developers, we've ran into this a few times already. The proposed patch would be a great improvement for plugins, so I'm (boldly) pushing this for a next major release ;-)
Updated by Toshi MARUYAMA about 9 years ago
- Has duplicate Feature #6120: keep autologin cookie with several web browsers added
Updated by Moritz Scholz almost 8 years ago
+1
The current behavior makes working with both desktop and a mobile device really annoying. I wonder why this does not get more attention.
Updated by Go MAEDA almost 8 years ago
- Target version changed from Candidate for next major release to 3.4.0
I have tested the patch 0001-10840-allow-stay-logged-in-from-multiple-browsers.patch. It works fine as expected. Setting target version to 3.4.0.
Unfortunately 0001-Define-token-action-properties-explicitly.patch cannot be applied to the current trunk cleanly, I have not tested yet.
Updated by Gregor Schmidt almost 8 years ago
Updated by Jean-Philippe Lang almost 8 years ago
- Subject changed from allow "stay logged in" from multiple browsers to Allow "Stay logged in" from multiple browsers
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed
The refactoring patch is committed, thanks. Followed by a fix for SQL errors with PostgreSQL (Token.invalid_when_created_before
was never returning nil making next if validity_time.nil?
useless).
Updated by Toshi MARUYAMA over 7 years ago
- Related to Feature #26617: stop Concurrent season added