Difference between revisions of "GETSESSIONVAR()"

From Lianjapedia
Jump to: navigation, search
(Created page with "==Purpose== Function to return the value of a session variable in a .rsp script or return an alternative value if the variable does not exist ==Syntax== GETSESSIONVAR(<expC1>...")
 
 
Line 6: Line 6:
  
 
==See Also==
 
==See Also==
[[ARRAY()]], [[FOREACH]], [[FUNCTION]], [[GETMEMBER()]], [[GETPARAMTER()]], [[PARAMETERS]], [[PARAMETERS()]], [[PCOUNT()]], [[PROCEDURE]], [[RETURN]], [[SET PROCEDURE]]
+
[[ARRAY()]], [[FOREACH]], [[FUNCTION]], [[GETMEMBER()]], [[GETPARAMETER()]], [[PARAMETERS]], [[PARAMETERS()]], [[PCOUNT()]], [[PROCEDURE]], [[RETURN]], [[SET PROCEDURE]]
  
 
==Description==
 
==Description==

Latest revision as of 11:49, 19 May 2014

Purpose

Function to return the value of a session variable in a .rsp script or return an alternative value if the variable does not exist

Syntax

GETSESSIONVAR(<expC1>, <expC2>)

See Also

ARRAY(), FOREACH, FUNCTION, GETMEMBER(), GETPARAMETER(), PARAMETERS, PARAMETERS(), PCOUNT(), PROCEDURE, RETURN, SET PROCEDURE

Description

The GETSESSIONVAR() function is used in .rsp scripts to return the value of a session variable or return an alternative value if the variable does not exist. The name of the variable is specified in <expC1>. An alternative value for the variable is specified in <expC2> and this will be read if the variable does not exist.

Example

ss=len(_SESSION)
if ss > 0
	? "Active session variables ("+alltrim(str(ss))+")"
	foreach _session as name=>value 
		? "<br>   &name="+etos(value)
		next
else
	? "There are no active session variables."
endif
 
?"<br>"
? "start_time = " + getsessionvar("start_time",time())
?"<br>"