You can get the cookies using the ServerXMLHTTP object to create an XHR, e.g.:
function getCookie(URL) {
var response;
var XmlHttpRequest = Sys["OleObject"]("MSXML2.ServerXMLHTTP.3.0");
XmlHttpRequest.open("GET", URL, false);
XmlHttpRequest.send();
try {
response = XmlHttpRequest.getAllResponseHeaders();
} catch (e) {
response = "Error";
}
XmlHttpRequest = null;
return response;
}
function TESTCookie() {
}
This actually shows you all the headers, I'll leave it to you to parse the cookies from the response:
Cache-Control: private, no-store, must-revalidate
Date: Wed, 07 Aug 2013 14:34:39 GMT
Content-Length: 107612
Content-Type: text/html; charset=utf-8
Server: SuperBear Server
Set-Cookie: ASP.NET_SessionId=kwh4do4zajcrzrwcct2xu; path=/; HttpOnly
Set-Cookie: VisitorStatus=110584414; expires=Sun, 07-Aug-2033 14:34:39 GMT; path=/; HttpOnly
Set-Cookie: ASP.NET_SessionId=kwh4do4zajcrzrwcct2xu; path=/; HttpOnly
Set-Cookie: VisitorStatus=110584414; expires=Sun, 07-Aug-2033 14:34:39 GMT; path=/; HttpOnly
Set-Cookie: CurrentTheme=Forums1; expires=Thu, 08-Aug-2013 14:34:39 GMT; path=/; HttpOnly