0 Replies Latest reply on Mar 8, 2010 8:33 PM by norvinet

    How do I add a Cookie to html control

    norvinet

      I want to add a cookie to an html control in my application before any page is loaded within the control.

       

      Im trying to do it like this.

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="init()"
      >

      <mx:Script>
        <![CDATA

         private function init():void {
          html.htmlLoader.manageCookies = true;
          html.htmlLoader.userAgent = "Custom User Agent";
          html.htmlLoader.window.document.cookie = "cookieKey=CookieValue; path=/";
         }

        ]]>
      </mx:Script>

      <mx:HTML id="html" />

      </mx:Canvas>

       

      If i set the location of the html control then the custom userAgent works, but the cookie doesn't.

       

      Any ideas,

      Thanks in advance.

      Richard