####
# user configurable variables:
####
$debug = 1;
#Change the below setting which is in seconds to desired value. Default is set to 2 minutes
$time_out = 120;
####
$user = connection.data.get( "uname" );
if( string.length( $user ) ) {
if( $debug ) { log.info( string.append( "Username: ", $user, " found in the connection data" ) ); }
# note that we cannot use http.getResponseCookie("JSESSIONID") because view server sends two cookies
$cookies = http.getResponseCookies();
$sess_id = $cookies["JSESSIONID"];
string.length( $sess_id ) ) {
$pool = connection.getPool();
$node = connection.getNode();
$port = string.extractPort( $node );
$node = string.extractHost( $node );
$seconds = sys.time() + $time_out;
if( $debug ) {
log.info( string.append( "Cookie JSESSIONID: '", $sess_id, "'", " for user ", $user ) );
log.info( string.append( "Value: Pool=", $pool, " Node=", $node, " Timeout=", $seconds ) );
}
data.set( $sess_id, [ "pool" => $pool, "node" => $node, "port" => $port, "user" => $user ] );
data.set( $user, [ "pool" => $pool, "node" => $node, "timeout" => $seconds, "sessionid" => $sess_id ] );
}
}