Creating URLs for login and logout
You can use URLs to take users directly to a login or logout page. When you take users directly to a login page, you must specify a URL to which the user will go after logging in. You might also want users to access an alternate URL after logging out.
Parameters for login and logout
The following table shows the URL parameters that apply to login and logout. All parameters and values are case sensitive.
Parameter | login.jsp | LoginServlet | logout.jsp | LogoutServlet |
---|---|---|---|---|
goto | Required | Required | Not applicable | Optional |
server | Required | Required | Not applicable | Not applicable |
username | Not applicable | Required | Not applicable | Not applicable |
pwd | Not applicable | Required | Not applicable | Not applicable |
auth | Not applicable | Optional | Not applicable | Not applicable |
returnBack | Not applicable | Optional | Not applicable | Not applicable |
The goto parameter redirects users to an alternate URL after login or logout. Any URL after a goto statement must be URL-encoded.
Use the enc parameter to specify the type of character encoding used in other parameters, such as UTF-8 or Shift_JIS.
When you use login and logout parameters in URLs, use the following guidelines:
- To have users log on manually, specify login.jsp.
- To take users to the logout page only, specify logout.jsp or specify LogoutServlet without the goto parameter.
- To have users go directly to an alternate URL, specify LoginServlet or LogoutServlet and the goto parameter.
- When creating login and logout URLs, do not include quotation marks around parameter values.
Examples for using URLs for login
The following examples show how to use URLs for login.. In these examples, midTierServer is the name of the web server, arsys is the default context path, and URL is a valid URL. When creating login URLs, do not include quotation marks around parameter values.
Example 1: Login with default login page
The user logs in by using the default login page, and then goes to the specified URL.
Example 2: Login with customized login page
The user logs in by using a login page customized for an application, and then goes to the specified URL.
Example 3: User logged in automatically
The user is logged in automatically and goes directly to the specified URL.