Re: Setcookie()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
>
>   
>> 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
>>
>>
>>     
>
>   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux