Hi there, I still have the same problem:
If I visit the plain HTML site, click on my login form, submit the correct user details --> I get the user + password form from Zen, the cookie appears not to be set.
If I then click on the same login link and try again, I get logged in and the cookie is set.
My code is as follows - I feel I'm really close to the solution so I hope you can help me wrap things up!
<?php
require_once("lib-utf8.php");
require_once("functions-db.php");
$post_user = $_POST["user"];
$post_pass = $_POST["pass"];
if(checkLogon($post_user, $post_pass))
{
setcookie("zenphoto_auth", md5($post_user . $post_pass), time()+5184000, "/");
header('Location: http://www.mysite.com/zenphoto/' . $post_user);
}
else
{
setcookie("zenphoto_auth", "", time()-368000, "/");
header('Location: http://www.mysite.com/login-failed.html');
}
?>