When configuration variable UseJSRedirect is used (mostly on IIS web server), then transition template "redirect" is used during login/logout operations. In u:OnLogout event (that performs logout) lines are switched and there is a moment, when there is no "user_id" variable stored in session. This results in redirect to "no_permission" template during logout instead of redirect to "index" template as usual.