Demos

Cookie Auth: Use Cookie Authentication

The setCookieAuth function takes a string, formatted as an HTTP cookie, that will be sent as a header when requesting the download associated with this DLM object. The cookie provides proof of authenticity to servers that require cookies before serving files via the DLM and Akamai NetSession Interface. The Akamai NetSession Interface will prefix this value with "Cookie:", so you do not need to specify that string in the value passed to this function.

Also, the dlmContainer and startDLM HTML elements are already defined in this page.

Click the Start download link to run the demonstration. You can pause and restart the download. If you haven't installed the NetSession client, you'll be prompted to download and install it first.

Code


    var url = "http://client.akamai.com/install/test-objects/cookie-auth/rand-1MB.bin";
    var dlm = new DLM(DLMCID, url, null, "dlmContainer", "startDLM");
    dlm.downloadPath = "prompt";
    dlm.setCookieAuth("cookietoken=test");;
              

NetSession Download Manager demonstrations