Re: Multiple cookies on the same computer
| From: | Shawn McKenzie | Date: | Fri, 27 Mar 2009 14:19:34 +0000 |
| Subject: | Re: Multiple cookies on the same computer | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290754@lists.php.net to get a copy of this message | ||
Ken Watkins wrote:
>>>> On 3/26/2009 at 11:12 PM, in message <70.12.30978.2144CC94@pb1.pair.com>,
>>>> Shawn McKenzie <nospam@mckenzies.net> wrote:
> Shawn McKenzie wrote:
>> Ken Watkins wrote:
>>> Hi all.
>>>
>>> Newbie here.
>>>
>>> I have set up a blog site where my family creates posts and they get emailed to members
>>> of the family. To keep up with their identities, I created a script for each family member to run
>>> (dad.php, mom.php, etc.), and it sets a cookie on each computer and uses sessions so I know who is
>>> connecting. It works great unless I want to share a computer between two users.
>>>
>>> I thought I had a solution: install both Firefox and IE on the same computer and set
>>> two different cookies. But this doesn't seem to work. My question is: Is it possible to set one
>>> cookie for IE and another for Firefox so that, depending on which browser is used, I can tell who is
>>> connecting to the blog? If this is not possible, is there another easy way to do it?
>>>
>>> Thanks for your help.
>>>
>>> - Ken Watkins
>>>
>>>
>> Even if you don't need it secure, have a login. Dad and mom can login
>> with dad or mom with no password if all you need to do is give them
>> their own cookie/session.
>>
>>
>
> Optionally, I just thought that if this was too much for them to
> do/remember, they could have their own bookmarks, like "Dad - Yoursite"
> (http://www.yoursite.com/index.php?person=dad) and Mom - Yoursite
> (http://www.yoursite.com/index.php?person=mom) and set the
> session/cookie or whatever you're doing based on $_GET['person'].
>
> I would still opt for the login though, even if not secure.
>
No, they use their own cookies so if you want to do it that way, use:
$_SERVER['HTTP_USER_AGENT'] and set the cookie based upon the browser.
Another thought I had was if you can add domain aliases,
dad.yoursite.com and mom.yoursite.com, then they will each have
different cookies.
--
Thanks!
-Shawn
http://www.spidean.com