Repository navigation
Commit 626eed5
committed
fix(session): keep remembered logins across the session timeout
A session that was idle for longer than session_lifetime is ended with a
full logout, which also deletes the remember-me cookies. The user is logged
out for good, although they asked to stay logged in and the documentation
of session_lifetime says a remembered login is transparently
re-authenticated after the session expired.
End such a session with endInactiveSession() instead: when the request
carries valid remember-me cookies for the current session, only the
session data is dropped. The session token is renewed for the new session,
so the user stays logged in, and the remember-me cookies and the stored
remember-me token get a fresh lifetime. The cookies must belong to the
user of the session token. No user backend is set up yet when a session
times out, so the session token tells whose session it is. Any other
request keeps being logged out as before.
In maintenance mode or with a pending upgrade, such a session only loses its
data, and the remember-me cookies sign the user in again afterwards.
The remember-me login is now only attempted with cookies that are strings,
and loginWithCookie() requires strings. Clients can send the cookies as
arrays, which ended in a TypeError for nc_username and nc_session_id.
Assisted-by: ClaudeCode:claude-opus-5
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>1 parent ad4cf1a commit 626eed5
4 files changed
Lines changed: 367 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
495 | 500 | | |
496 | 501 | | |
497 | 502 | | |
| |||
1299 | 1304 | | |
1300 | 1305 | | |
1301 | 1306 | | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
1305 | | - | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
1306 | 1313 | | |
1307 | 1314 | | |
1308 | 1315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
903 | | - | |
904 | | - | |
905 | 903 | | |
906 | 904 | | |
907 | | - | |
| 905 | + | |
908 | 906 | | |
909 | 907 | | |
910 | 908 | | |
911 | 909 | | |
912 | 910 | | |
913 | 911 | | |
914 | 912 | | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
| 913 | + | |
919 | 914 | | |
920 | 915 | | |
921 | 916 | | |
| |||
949 | 944 | | |
950 | 945 | | |
951 | 946 | | |
952 | | - | |
| 947 | + | |
953 | 948 | | |
954 | 949 | | |
955 | 950 | | |
| |||
1001 | 996 | | |
1002 | 997 | | |
1003 | 998 | | |
1004 | | - | |
| 999 | + | |
1005 | 1000 | | |
1006 | 1001 | | |
1007 | 1002 | | |
| |||
1033 | 1028 | | |
1034 | 1029 | | |
1035 | 1030 | | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1036 | 1096 | | |
1037 | 1097 | | |
1038 | 1098 | | |
| |||
1089 | 1149 | | |
1090 | 1150 | | |
1091 | 1151 | | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
1092 | 1176 | | |
1093 | 1177 | | |
1094 | 1178 | | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
| 1179 | + | |
| 1180 | + | |
1098 | 1181 | | |
1099 | | - | |
| 1182 | + | |
1100 | 1183 | | |
1101 | 1184 | | |
1102 | 1185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
0 commit comments