Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript cookies/perl problem

    okay so i got a login that sends its name/password to a perl script which looks up the names and passwords in a text file, and if a name and password is correct, it sets a cookie called user with the value of the user name. Now I know this is riddiculously insecure but im just getting started and eventually ill have it better. BUT the cookie can only be accessed by html pages that are in the cgi-bin folder, not the root folder. Soo how do i get around that?
    Took me 2 hours to figure out why the cookie kept coming up as null. Any help is appreciated, i think ive met my match.

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to set the domain and the path to root to have the cookie read site wide...

    Code:
    var date = new Date();
           date.setTime(date.getTime() + 365*24*60*60*1000);
           var expString = '; expires = '+date.toGMTString();
               expString += '; domain = '+location.host+'; path=\/;'
    .....Willy


  •  

    Posting Permissions

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