You need to explain “not work” or “problem exists”.
- What did you see? Any error message?
- Did you enable Debug? Any error message in the log file?
- Did you check Network panel in your browser? What is the response, any redirection URL? As always, you should check HTTP response.
- You may also add log to debug your code, e.g.
Log("Login - Page_Redirecting", [$userLevel, CurrentUserLevel(), IsLoggedIn(), CurrentUserInfo("SupportStaff")]);
See the result in log file, check if any of the cases in your code is met.