Link to home
Start Free TrialLog in
Avatar of hitman3030
hitman3030

asked on

Can only read javascript cookie with .net in directory it was created?

I have a cookie set on landing page with javascript like below:

...
setCookie('cSizeSpeed', speedsize, 1);
...

   function setCookie(c_name, value, exdays) {
        var exdate = new Date();
        exdate.setDate(exdate.getDate() + exdays);
        var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
        document.cookie = c_name + "=" + c_value;
    }

Open in new window


I can read it on the next page using this vb code, but only if that page is in the same directory where the javascript created it. How can I overcome this limitation?

       
   If Not IsNothing(Request.Cookies("cSizeSpeed")) Then
                strSpeedSize = Request.Cookies("cSizeSpeed").Value
        End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial