1 (edited by mogster 2007-04-02 14:22)

Topic: changing password

after I change password (update the table) and call the pun_setcookie()-function it logs me out of the system...why is that?

$expire = ($save_pass == '1') ? time() + 31536000 : 0;
pun_setcookie($pun_user['id'], $new_pwd, $expire);
check_cookie($pun_user);

EDIT:

after I set the cookie I try to run check_cookie($pun_user); ..I guess it's where I'm getting logged out, but I can still not figure out why. Any ideas?

Re: changing password

You're producing the cookie incorrectly. From checkcookie():

if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) !== $cookie['password_hash'])
Looking for a certain modification for your forum? Please take a look here before posting.

Re: changing password

Thanks for your answer pogenwurst. I'm still a bit confused though tongue

I'm using pun_hash() to generate the password..is this what I'm doing wrong?

$new_pwd = pun_hash($form_new_pwd1);

Re: changing password

$expire = ($save_pass == '1') ? time() + 31536000 : 0;
$pun_user['password'] = $new_pwd;
pun_setcookie($pun_user['id'], $new_pwd, $expire);
check_cookie($pun_user);

That should fix it