Issue #2396013 by wesleydv: Code to destroy local user session is wrong