Vortex -- share session vars across scripts?

Post Reply
User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

Vortex -- share session vars across scripts?

Post 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.)








User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

Vortex -- share session vars across scripts?

Post 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


Post Reply