Jump to content

Store array in cookie


FMATeam

Recommended Posts

I'm trying to store some array keys in a cookie

 

$USERS["user1"] = "random MD5 hash";
$USERS["user2"] = "another random MD5 hash";
$USERS["user3"] = "another random MD5 hash";

 

this is basically a login system and i'm trying to display the username used by any user when they login.

I'm trying to store the key in the cookie. Then recall it and print it using another file so it'll say "Welcome user1" or whatever.

 

Can anyone help...cheers

Link to comment
https://forums.phpfreaks.com/topic/127157-store-array-in-cookie/
Share on other sites

Thanks DarkWater

 

Why do you want to store User2's info on User1's and User3's PC, and so on?

 

I'm not. What I'm trying to do is store the users username in a cookie and recall it and print it when they've logged in.

E.g. when user1 logs in I want the homepage to say, "Welcome user1" and when user2 logs in, the homepage will say "Welcome user2"

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.