Skip to content

Commit 93dfb1a

Browse files
SW-565 Fix remember me and IPv4/IPv6 sessions (#113)
* Fix remember me and IPv4/IPv6 sessions Session protection mode "strong" is apparently incompatible to the remember me function in general and on top of that I observed issues with at least Windows happily switching between connecting to an instance via IPv4 and IPv6, causing changes in the reported client IP and hence the session protection killing the session as a result. Co-authored-by: Gina Häußge <gina@octoprint.org>
1 parent 66b89e3 commit 93dfb1a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/octoprint/server/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,12 @@ def template_disabled(name, plugin):
438438
events.DebugEventListener()
439439

440440
loginManager = LoginManager()
441-
loginManager.session_protection = "strong"
441+
442+
# "strong" is incompatible to remember me, see maxcountryman/flask-login#156. It also causes issues with
443+
# clients toggling between IPv4 and IPv6 client addresses due to names being resolved one way or the other as
444+
# at least observed on a Win10 client targeting "localhost", resolved as both "127.0.0.1" and "::1"
445+
loginManager.session_protection = "basic"
446+
442447
loginManager.user_callback = load_user
443448
if not userManager.enabled:
444449
loginManager.anonymous_user = users.DummyUser

0 commit comments

Comments
 (0)