Modified the names of session variables.
If there is any error in the server response, display it.
Reorganized redirection functions.