Page 1 of 1
Vortex -- share session vars across scripts?
Posted: Sun Jan 18, 1998 4:43 pm
by Thunderstone
As we asymptotically approach a decision to buy the full
Webscript setup, there is (always) one more question:
We envision delivering every page on the site through
Webscript. Can different scripts share session variables --
like a user ID that determines whether a user has or hasn't
paid to see a certain page? (I have searched the Vortex
docs; all the references I have found are to
re-invocation of the current script.)
Vortex -- share session vars across scripts?
Posted: Mon Jan 19, 1998 11:45 am
by Thunderstone
Vortex variables cannot currently be EXPORTed across different
scripts. One way to pass them among scripts, however, is to encode them
in cookies, at the start of each page's HTML:
<HEAD>
<strfmt "User=%U&Book=%U" $User $Book>
<fmt '<META HTTP-EQUIV=Set-Cookie CONTENT="MyCookie=%U; path=/;">\n' $ret>
</HEAD>
This would set 2 variables, $User and $Book, in a cookie named MyCookie.
Upon re-invocation of any page (eg. Vortex script) on the same site,
$User and $Book would be automatically set from MyCookie. <encrypt>
could be used to encode the vars for additional security.
See our bookstore example,
http://www.thunderstone.com/texis/demos/bookstore/, for an example usage
of cookies in Vortex. Also see:
http://home.netscape.com/newsref/std/cookie_spec.html for more on
HTTP cookies in general.
-Kai