comparison core/sessionmanager.lua @ 13095:1693bd4de283

core.sessionmanager: Delay closing a replaced connection after replacement Closing the session invokes ondisconnect and session close logic, including mod_smacks hibernation and the timer that destroys the session after a timeout. By closing the connection after it has been detached from the sessions table it will no longer invoke the ondetach handler, which should prevent the above problem.
author Kim Alvefur <zash@zash.se>
date Sun, 07 May 2023 12:27:55 +0200
parents 7b952553bd60
children d649d011df45
comparison
equal deleted inserted replaced
13094:4002f0aa6a04 13095:1693bd4de283
98 to_session.log("debug", "Updating with parameters from session %s", from_session.id); 98 to_session.log("debug", "Updating with parameters from session %s", from_session.id);
99 from_session.log("debug", "Session absorbed into %s", to_session.id); 99 from_session.log("debug", "Session absorbed into %s", to_session.id);
100 100
101 local replaced_conn = to_session.conn; 101 local replaced_conn = to_session.conn;
102 if replaced_conn then 102 if replaced_conn then
103 to_session.log("debug", "closing a replaced connection for this session"); 103 to_session.conn = nil;
104 replaced_conn:close();
105 end 104 end
106 105
107 to_session.since = from_session.since; 106 to_session.since = from_session.since;
108 to_session.ip = from_session.ip; 107 to_session.ip = from_session.ip;
109 to_session.conn = from_session.conn; 108 to_session.conn = from_session.conn;