session validation and redirection.