Jump to content

chaos421

Members
  • Posts

    1
  • Joined

  • Last visited

About chaos421

  • Birthday 04/01/1978

Profile Information

  • Location
    Minnesota

chaos421's Achievements

Newbie

Newbie (1/7)

0

Reputation

  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...