Add scope="session" to <set>; replace setenv with it
<set name="x" value="..." scope="session"> now writes x to the session file (any name, no @ prefix); values are still read with $[@x]. storeVariable passes the scope through instead of repeating the global/local/parent checks for each value source. Convert every <setenv> use on barant-site and qualityiron-site to a plain <set> plus a scope="session" <set>, which keeps same-request $[name] reads working, and remove setenv from both SESSIONCTL.tag copies (sessionctl is deprecated for session management). Document session variables and the set tag scopes in the Jet manual. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
867ace3cb3
commit
08462ca996
26 files changed
+108
-82
No files matched your search
Binary file not shown.
+51
-5
@@ -95,9 +95,12 @@ specifying the scope of global.
|
||||
\item Keyword - within a tag's container we may access the keyword
|
||||
values specified on the containing tag.
|
||||
|
||||
\item Environment -
|
||||
\item Session - values stored in the session file with the set tag and
|
||||
a scope of session. They persist across requests from the same browser.
|
||||
|
||||
\item CGI Variables -
|
||||
\item Environment -
|
||||
|
||||
\item CGI Variables -
|
||||
|
||||
\end{itemize}
|
||||
|
||||
@@ -120,6 +123,32 @@ the container where they are defined. Some containers may not be
|
||||
capable of storing local variables (i.e. set tag) and are inheriting
|
||||
the local scope from their parent tag.
|
||||
|
||||
\section{Session Variables}
|
||||
|
||||
Session variables are stored in the session file for the current
|
||||
session and remain available to later requests from the same browser.
|
||||
Session control must be enabled (see Session Control).
|
||||
|
||||
A session variable is written with the set tag and a scope of
|
||||
session:
|
||||
|
||||
\begin{verbatim}
|
||||
<set name="_login_id" value="$[login_id]" scope="session">
|
||||
\end{verbatim}
|
||||
|
||||
The name can be any variable name. It does not need an @ prefix.
|
||||
Session variables are read with the \$[@name] syntax, for example
|
||||
\$[@\_login\_id].
|
||||
|
||||
Setting a session variable does not also set a global variable of
|
||||
the same name. When the same request needs to read the value as
|
||||
\$[name], set it with both scopes:
|
||||
|
||||
\begin{verbatim}
|
||||
<set name="_login_id" value="$[login_id]">
|
||||
<set name="_login_id" value="$[login_id]" scope="session">
|
||||
\end{verbatim}
|
||||
|
||||
\section{Keyword Variables}
|
||||
|
||||
Keyword variables are set when they are specified on a containing tag.
|
||||
@@ -299,8 +328,16 @@ into the directory named after the token. Captured session data will
|
||||
become available to future requests coming into the server and made
|
||||
available through the variable formats for the session.
|
||||
|
||||
The <set> tag will also have an additional scope value that can be
|
||||
used to store the value in the session. This is scope="session".
|
||||
Under APIServer, session control is enabled for a site by its
|
||||
sessionDir setting in the server configuration instead of the <jet>
|
||||
tag.
|
||||
|
||||
Use the <set> tag with scope="session" to store a value in the
|
||||
session, and \$[@name] to read it back (see Session Variables).
|
||||
|
||||
The session tags in SESSIONCTL.tag are deprecated for session
|
||||
management. Its setenv tag has been removed, and the startsession and
|
||||
endsession tags are no longer provided. Use scope="session" instead.
|
||||
|
||||
|
||||
|
||||
@@ -488,7 +525,16 @@ value
|
||||
|
||||
container
|
||||
|
||||
scope
|
||||
scope - where the variable is stored. The values are:
|
||||
|
||||
\begin{itemize}
|
||||
\item global - the default. Available to all logic for the rest of the
|
||||
request.
|
||||
\item local - available only within the container where it is set.
|
||||
\item parent - stored in the scope of the enclosing tag.
|
||||
\item session - stored in the session file and kept across requests.
|
||||
Requires session control. See Session Variables.
|
||||
\end{itemize}
|
||||
|
||||
\section{sql}
|
||||
|
||||
|
||||
Reference in new issue
Block a user