PDA

View Full Version : Setting a cookie with the username


eljeffe
08-21-2005, 06:10 AM
I found the thread that discussed what was needed to set a cookie that contained the username. But I tried it, and couldn't get it to work.

Here is the snippet of code that I added in the login.php (in two places):

vbsetcookie('userid', $bbuserinfo['userid'], 0);
vbsetcookie('password', md5($bbuserinfo['password'] . 'L45537ea'), 0);
vbsetcookie('username', $bbuserinfo['username'] );

^^^^ This is the set cookie line of code recommended in the earlier thread.

I've made this change, and no username cookie shows up.

Any ideas?

merk
08-21-2005, 06:17 AM
Have you tried logging out then logging back in? That cookie will only appear when you login.

eljeffe
08-21-2005, 06:27 PM
Yeah, I tried logging out. I also cleared all my cookies and watched the cookie manager to see what cookies show up. For some reason, the username cookie isn't getting set.

Colin F
08-21-2005, 08:16 PM
I found the thread that discussed what was needed to set a cookie that contained the username. But I tried it, and couldn't get it to work.

Here is the snippet of code that I added in the login.php (in two places):

vbsetcookie('userid', $bbuserinfo['userid'], 0);
vbsetcookie('password', md5($bbuserinfo['password'] . 'L45537ea'), 0);
vbsetcookie('username', $bbuserinfo['username'] );

^^^^ This is the set cookie line of code recommended in the earlier thread.

I've made this change, and no username cookie shows up.

Any ideas?

Possibly you need to set the third parameter, which is a 0 on the top two function calls?

eljeffe
08-21-2005, 09:19 PM
Tried that, no dice