Re: switching between admin areas on two domeins with one login?

From: Date: Thu, 23 Mar 2006 23:36:53 +0000
Subject: Re: switching between admin areas on two domeins with one login?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-232479@lists.php.net to get a copy of this message
afan@afan.net wrote:
Hi to all, have two domains and each domain has it's own admin registered areas. Have to allow people who registered to change domains and areas without login again? On reg. areas, after login, create sess_id to check if visitor is logged in, but sess_ids on domains are different and can't compare them?
Apart from the other suggestion, you could also set a cookie with the details you need to access in it. See http://www.php.net/setcookie Don't just use the userid (or whatever you're using) in the cookie - also add a random string to the end so it's not predictable (I use the following and it works quite well): $rand_check = uniqid(true); $oneyear = time() + (365 * 24 * 3600); // one year's time. $usercookie_info = array('user' => $userid, 'time' => time(), 'rand' => $rand_check); setcookie('YourCookieName', base64_encode(serialize($usercookie_info)), $oneyear, '/'); -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#232479) next »