I have to agree Nuno, sessions are alot easier/simpler.
--
Chris Lee
[EMAIL PROTECTED]
"Nuno Silva" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello,
short:
try removing the third parameter to setcookie and if the errors go away
you know it's a cookie problem :)
long:
you're setting auth based in the (server's) time + 600sec. If the client
(or even the server) has a clock skew... well.... bad luck :)
removing the third parameter makes php create a "session cookie" that
will stay there until the browser is closed (alll the windows).
If this is not a problem, let it be. I love session cookies!! :)
Anyway, the best method to get decent auth are sessions. Try php4's
sessions or phplib or something.
Regards,
Nuno
Martin Skjöldebrand wrote:
> I'm experiencing all kinds of problems with, what we suppose is the cookie
> setting. This is the code:
>
> if (isset($authentication)) {
> setcookie("status", $status, time()+600);
> setcookie("user", $user, time()+600);
> setcookie("group", $group, time()+600);
> setcookie("authentication", $authentication, time()+600);
> setcookie("laston", $laston, time()+600);
> }
> else {
> setcookie("status", "Logged In", time()+600);
> setcookie("user", $txtUsername, time()+600);
> setcookie("group", $row[4], time()+600);
> setcookie("authentication", "YES", time()+600);
> setcookie("laston", $row[6], time()+600);
> }
>
> (I have not coded this).
>
> What seems to happen is that - with alarming regularity - people are
> getting logged off when choosing item from a menu. Either they are thrown
> out into the log on-screen or (as has happened to me recently) the app
> simply states I'm not logged on even if I am in the middle of using it (and
> must have logged on).
>
> I'm not at all familiar with cookies (yet) but suspect that the timing of
> the critters could be a culprit. IS this correct?
> How do I solve the problem?
>
> M.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]