Jump to content


  • Posts

  • Joined

  • Last visited

About chaos421

  • Birthday 04/01/1978

Profile Information

  • Location

chaos421's Achievements


Newbie (1/7)



  1. Hey all. First post here. I'm having some difficulty with cookies and Safari. I've pasted my code below. isValidUser is a function that queries the database. When I test it out on Chrome it works well. In Safari I'm able to log in, but as soon as I navigate away from the page, the cookies disappear. I've tried several permutations with the URL at the end of setcookie including with or without leading '.' and with or without trailing '/' without success. Any help would be greatly appreciated. Thanks, Keith /*------------------------------------------------------------------- * login * * username: is the person's e-mail address * password: is stored separately *-------------------------------------------------------------------*/function login ($username, $password){ if (!isValidUser($username, $password)) return false; setcookie('username', $username, time()+60*60*24*365, '/', '.northernlightsnordic.org'); setcookie('password', md5($password), time()+60*60*24*365, '/', '.northernlightsnordic.org'); return true;} //end login/*------------------------------------------------------------------- * logout * * *-------------------------------------------------------------------*/function logout (){ setcookie('username', "", time() - 3600, '/', '.northernlightsnordic.org'); setcookie('password', "", time() - 3600, '/', '.northernlightsnordic.org'); return true;} //end logout
  • Create New...