HasValue
Description
Returns a Bool indicating whether the specified session variable exists.
Session variables persist until the Session object is deleted. To get or set variables, use the NameValue method.
Syntax
VBScript
session.HasValue
(name)
Perl
$session->HasValue
(name);
- Identifier
- Description
- session
- The Session object that represents the current database-access session.
- name
- A String containing the name of the session variable.
- Return value
- Returns Boolean True if the variable exists in this session, otherwise False.
Examples
VBScript
set sessionObj = GetSession
' Test for existence of the web session variable
if sessionObj.HasValue ("_CQ_WEB_SESSION") then
Value = sessionObj.NameValue("_CQ_WEB_SESSION")
' Either exit or do something else
end if
Perl
# Get a HCL Compass
session
$sessionObj = $entity->GetSession();
# Test for existence of the web session variable
if ($sessionObj->HasValue("_CQ_WEB_SESSION")) {
$Value = $sessionObj->GetNameValue("_CQ_WEB_SESSION");
# Either exit or do something else
}