weemikey Posted September 28, 2007 Share Posted September 28, 2007 Hi all. I read quite a bit before posting because I just didn't find the info I was looking for. I'm a fairly new PHP guy, and an intermediate coder overall, so I'm usually in over my head. Right now I'm trying to connect a pre-made piece of PHP software (document management) to my own contact manager. So the user logs into the system we paid for and a cookie gets set with a SESSION ID in it. There's a table in the database of the software that logs user id's with the SESSION ID. I THINK I need to do a getcookie() on the PHPSESSID cookie that I see in my cookie list. I can take the SESSION ID that I find there and look up the user id, and from that the username in the database. I only need a username so I can do a "last_user" field in the contact manager I wrote to integrate into the existing system. Is that a reasonable solution? Could there be any confusion if I specify the "PHPSESSID" cookie, or is there really only the ONE that was created when the user first logs in? I'd appreciate any advice..... Thanks! Mike Quote Link to comment https://forums.phpfreaks.com/topic/70997-another-session-question/ Share on other sites More sharing options...
sKunKbad Posted September 28, 2007 Share Posted September 28, 2007 you wouldn't getcookie, you would start your session and then: $var = $_SESSION['user_id']; //to get the user id, assuming user_id is in the $_SESSION array. $var2 = $_SESSION['user_name']; //to get the user name, assuming user_name is in the $_SESSION array. Quote Link to comment https://forums.phpfreaks.com/topic/70997-another-session-question/#findComment-356975 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.