Maintain a user session |
|
Problem:HTTP is stateless and connectionless. Since the Web server does not recognize the user, every page request is treated as a fresh request. However, I want to let the user "maintain the session." To be specific, when the user accesses two or more databases through the Web, he/she does not need to relogin over and over, given that Web security is not used.
Solution:
There are several ways to achieve this goal such as using record ID, cookie, and token. I prefer the last method to the other two. Basically, the token passing method is to capture a value into a token. This token can be passed to other pages and the value contained in the token can be used later. To create a token, in the first page insert the following hidden input. If you want to put more than one field value into the token, use a comma to separate them:
|
To keep on passing the token, the subsequent pages should carry the following hidden input even if the token is not used in those pages:
|
At some point the user may leave the current database and go into another database. The following hidden input can let the user open another database without relogging in.
|
FMP Tips Contents
|
|