FileDownloader.Cookie Property

Supported browsers: FirefoxGoogle ChromeSafari

Cookies which should be used in download process.

Syntax

Initialize

JavaScript
<script type="text/javascript" src="iuembed.js">  </script>
<script type="text/javascript">
var fd = new FileDownloaderWriter("FileDownloaderID", 610, 500);
//...other params...
fd.addParam("Cookie", "");
//...other params...
fd.writeHtml();
</script>

Get/Set Value in Runtime

JavaScript
getFileDownloader("FileDownloaderID").setCookie(value);
value = getFileDownloader("FileDownloaderID").getCookie();

Property Value

The cookie string.

Default value is "".

Remarks

Most browsers, such as Firefox since version 2.0.0.5 support HTTP-only cookies. They make it impossible to read these cookies using JavaScript. It increases security and prevents your site from cross-site scripting attacks.

When File Downloader is about to download files, it extracts all cookies downloaded along with the page that hosts File Downloader. To get cookie, File Downloader uses the same object model as you do in JavaScript (as if you use document.cookie). However, the browser does not allow File Downloader to get HTTP-only cookies. Thus, you should use the property to pass authentication cookies if you use cookie-based authentication.

This property accepts cookie in the following format: "cookieName=cookieValue", use the semicolon to separate several cookies.

See Also

Manual