Skip to Content
0
Former Member
Oct 19, 2005 at 08:20 PM

Pull externaly defined cookie into BSP using JavaScript

15 Views

Hi experts,

I have created an externally defined cookie using VB.NET. I would like to pull this cookie into my BSP.

I am using the following code and I keep getting a NULL in return. Any ideas?

Thanks in advance!

<script language = "JavaScript">

function GetCookie (name) {

var arg = name + "=";

var alen = arg.length;

var clen = document.cookie.length;

var i = 0;

while (i < clen) {

var j = i + alen;

if (document.cookie.substring(i, j) == arg)

return getCookieVal (j);

i = document.cookie.indexOf(" ", i) + 1;

if (i == 0) break;

}

return null;

}

</script>

Within the HTML Body I put:

<SCRIPT>document.write (GetCookie("LoginUser"))</SCRIPT>