Re: Setcookie()
| From: | Micah Gersten | Date: | Sun, 12 Oct 2008 22:51:45 +0000 |
| Subject: | Re: Setcookie() | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-281776@lists.php.net to get a copy of this message | ||
The question is, why aren't you using a session variable instead of
cookies? That's one of the greatest features of PHP.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Ben Stones wrote:
> What I mean is I cannot use setcookie, I need to check if user credentials
> are correct first (which is BEFORE setcookie) and if so, set a cookie. I
> can't do that unless setcookie is first, but I need to check if the user
> credentials is correct. Furthermore I cannot use setcookie in the header as
> I want to display a message saying that they have successfully logged in in
> the correct area of my template.
>
> 2008/10/11 Per Jessen <per@computer.org>
>
>
>> Ben Stones wrote:
>>
>>
>>> I'm using cookies for my website script and upon users logging in a
>>> cookie is set. Problem for me is that the cookie doesn't work due to
>>> headers already sent. Is there anyway of fixing this because, there is
>>> no possible way of adding setcookie() to the top of the PHP file when
>>> the cookie is holding the username from the POSTed form.
>>>
>> This must be a self imposed restriction on your side, coz' otherwise I
>> see no problem.
>>
>>
>> /Per Jessen, Zürich
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>