Isn't it possible to save more information that one line in a cookie?
line1: name
line2: pw
line3: some security check
And have it like this:
$_COOKIE['mypage_cookie']['name']
$_COOKIE['mypage_cookie']['pass']
$_COOKIE['mypage_cookie']['hash']
If so, how do I solve it? Thanks.
Cookie question - more information in one cookie
Moderator: General Moderators
- Peter Anselmo
- Forum Commoner
- Posts: 58
- Joined: Wed Feb 27, 2008 7:22 pm
Re: Cookie question - more information in one cookie
All cookies are simply key/value pairs. You would need to create a separate cookie for each value.
Does your user have separate logins for different pages on your site? If not, why not just change this:
to this:
Does your user have separate logins for different pages on your site? If not, why not just change this:
Code: Select all
$_COOKIE['mypage_cookie']['name']
$_COOKIE['mypage_cookie']['pass']
$_COOKIE['mypage_cookie']['hash']Code: Select all
$_COOKIE['name']
$_COOKIE['pass']
$_COOKIE['hash']Re: Cookie question - more information in one cookie
Alternatively, you can serialize array to set it as a cookie's value, and unserialize it when you read it.