Re: Central authentication for multiple sites
| From: | Kevin Stone | Date: | Mon, 29 Sep 2003 19:33:25 +0000 |
| Subject: | Re: Central authentication for multiple sites | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164288@lists.php.net to get a copy of this message | ||
If all domains have access to the same database then there is absolutely nothing preventing you from
using a Cookie. Have a normal login on Domain1.com. Once authenticated produce a random ID and
store it in the database. Store the ID in a cookie then Redirect the client to the desired domain.
The page the client is redirected to checks to see if the ID matches one stored in the database. If
it does then the user is valid. A logout request on any one of the domains destroys the ID in the
database and erases the cookie. Associate a timestamp with the ID in the database so that you can
make the login invalid after a period of no activity.
- Kevin
"Fraser Campbell" <fraser@wehave.net> wrote in message news:200309291512.51582.fraser@wehave.net...
> Hi,
>
> Does anyone know of a way to authenticate a person on one site and have that
> authentication carried through to multiple sites?
>
> Basically I'd like to have someone login on www.domain1.com and then have
> their login be valid on www.domain2.com and www.domain3.com ... the domain
> name is different so I don't see how I could use a common cookie.
>
> The 3 sites in question are hosted on a common server with a common user
> database if that helps but still the domain names that people access the
> sites with are unique.
>
> Any ideas?
>
> Thanks!
> --
> Fraser Campbell <fraser@wehave.net>
> http://www.wehave.net/
> Halton Hills, Ontario, Canada Debian GNU/Linux