Quantcast
Channel: [Q&A - FAQ Neotys] Last questions
Viewing all articles
Browse latest Browse all 2283

Clear cookie ARRAffinity

$
0
0

I have a project with 1 server ARR and 2 IIS server.
The project contains 2 transactions, each use a diffrent cookie ARRAfinity to commit database informations. I want to clear this cookie after each used.
I have tried to write javascript, but the cookie ARRAffinity is not "cleaned". This code is correct for a simple cookie like an authentication cookie;

function ClearCookie( cookieName,cookieValue,cookiePath,serverName)
{
//Définition d'une date dépassée
var expires_date = new Date(0);
var cookie = cookieName+"="+cookieValue+"; expires=" + expires_date.toGMTString() +"; "+cookiePath;

logger.debug(cookie);

//
context.currentVU.setCookieForServer(serverName,cookie);

}

var ArrCookieName="ARRAffinity";
var myVar = context.variableManager.getValue("Ext_ARRAffinity");
logger.debug("ArrCookieName="+ArrCookieName);
if (myVar==null) {
context.fail("Variable 'Ext_ARRAffinity' not found");
}

logger.debug("myVar="+myVar);

var serverARR = context.variableManager.getValue("ServerArr");
ClearCookie("ARRAffinity",myVar,"Path=/app;Domain="+serverARR,serverARR);

The name of the server is the NeoLoad name of the server, not the physical one.


Viewing all articles
Browse latest Browse all 2283

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>