The Portal Object handles user login and logout transparently. All you need to do is to write a form that submit back to the main page (e.g. index.htm) with the input field "username", "password" and "Submit". (You may submit back to the virtual page if you use method="get", but this is not recommended for security reasons.)
The Submit input defines the authentication action: "login", "signin", "sign-in" and "sign in" mean to login; "logout", "signout", "sign-out" and "sign out" mean to logout.
FOLLOW ME {code}
As a recap, the sys%auth variable gives the following information about the logged in user:
- sys%auth:username - the username currently logged in under
- sys%auth:realm - the realm currently logged in under (if there's one)
- sys%auth:loginname - the full login name (user@realm)
- sys%auth:attribute - a user defined attribute (you can define attributes in the authentication data table or scheme file. e.g. Name, Company, Telephone etc)
There are several variables that the Portal Object gives (pt% is the Portal Object):
- pt%JustLoggedIn - True if the page was submitted a "login" and has it processed successfully.
- pt%JustLoggedOut - True if the page was submitted a "logout" and has it processed successfully.
- pt%AuthStatus - The Status code given by the "login" or "logout" command.
- pt%AuthMessage - The Message given by the "login" or "logout" command.
There are two variables that you can define in the Portal Object (either in the object creation line or in Scheme):
- pt%SessionTimeout - Number of seconds after login before the session is automatically logged out.
- pt%IdleTimeout - Number of seconds after last page access before the session is automatically logged out.
|