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.

Well, I'm doing exactly that and it works just fine. This is a rough
outline of the flow:

GET  <login page>   (form with user and password fields)
POST <login page> 

     validate user+password, save in session
     setcookie().
     redirect with 303 to <welcome page>

GET <welcome page>


/Per Jessen, Zürich


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

Reply via email to