Jump to content

[SOLVED] login cookie help


Yeodan

Recommended Posts

Some login cookie questions:

 

It seems impossible to store more than 1 value in a cookie, is this correct?

So I have to make multiple cookies to store multiple values?

 

What values should I store in my cookie?

I'm making a MMORPG browser game.

I think I need player name + password, wich are both required to log in. Is this correct?

 

Is it safe to store the password in a cookie?

Should I encrypt it or not? If I encrypt it, is that safe?

Doesn't sound very safe to me either way.

Link to comment
https://forums.phpfreaks.com/topic/156596-solved-login-cookie-help/
Share on other sites

I'm also getting this weird error:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/mortalas/public_html/login.php:7) in /home/mortalas/public_html/includes/login.php on line 110

 

line 110:

setcookie("MApNumber", $number, time()+32000000);

I'm also getting this weird error:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/mortalas/public_html/login.php:7) in /home/mortalas/public_html/includes/login.php on line 110

 

line 110:

setcookie("MApNumber", $number, time()+32000000);

Can you post the lines before that?

 

Also, have you heard of SESSIONS?

there's quite a lot of code in front of it, why? what conditions should be met to be able to set a cookie?

 

yes I've heard of sessions, my site uses sessions to log in users

I want to use cookies to remember the user next time he wants to play

 

Set a cookie with a value of something like:

array('id' => 'userid', 'name' => 'username', 'status' => 'registered')

 

And anything else you need. No need to put password. You should be able to reference the user by that alone. Heck, I would set sessions with those values.

so what if some registered player looks at his cookie and replaces his number with a random other number?

 

he'll have access to the other account ...

 

my sessions use: session id, player number, player ip

 

for the cookies I just want to use the player number and password

and I want the cookie to handle the login in stead of the form so ppl don't have to log in each time they visit the site

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.