GETSESSIONVAR()

From Lianjapedia
Jump to: navigation, search

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>"