www.webdeveloper.com
Results 1 to 2 of 2

Thread: Secure flag - JavaScript Cookies

Threaded View

  1. #1
    Join Date
    May 2011
    Location
    Florida
    Posts
    6

    Cool Secure flag - JavaScript Cookies

    So in JavaScript its written that we can use the ";secure" flag to set HTTPS only cookies. However, I'm not on SSL when I'm running debug locally and I find the cookie is still being written. Is this a bug or something I'm doing wrong?

    Code:
    var expDate = new Date();
    expDate.setDate(expDate.getDate() + 365);
    document.cookie = "mainFrameSize=" + 
                escape(document.getElementById("mainFrame").cols) + 
                ";expires=" + expDate.toGMTString() + ";secure";
    Edit: Using IE 7 on WinXP
    Last edited by Chizl; 09-20-2011 at 08:54 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles