/session Identifier The Sambar Server scripting files (*.stm) have a reference to a /session directory. For example, the following tag is used to login the user "guest" into the magazine demo:
<A HREF="/session/login?RCuser=guest&RCpage=/magazine/welcome.stm"> The /session directive indicates that a DLL function is being requested. In the above example, /session/login corresponds with the internal "login" function. Once the /session function is executed, if an RCpage is specified and no HTML was generated by the function, the page is displayed. In the above example, /session/login attempts to login the user "guest", assuming the function returns SA_SUCCEED, then the magazine welcome page is output. The /session/login function expects the argument RCuser and an option RCpwd (password parameter). If no RCpwd argument is provided, a password of NULL is expected. /session/login then attempts to login (see config/passwd) the user, sets a cookie for the user for future authentication, and creates a "state" structure associated with the user and maintained by the server. So as long as the user is logged in (logins timeout after a period of inactivity), any values set with RCS flags (state flags) will be maintained by the server. This is how the demo maintains user information/preferences etc. accross pages -- the demo gets and sets state variables. There is a second type of variable appropriate for users called profile variables (RCP arguments). This feature is not presently available in the public version of the sambar server. The RCP variables all you to persistently store attributes of a user so that when they login again, the RCP attributes are retrieved from disk (and can be get/set just like RCS attributes). This interface will probably expose this (and document it) in the 4.1 release. There is a /session/logout function for logging out and releasing the state information held by the server.
System-defined Tags
.stm files |