Firefox PHP

Doing a log out

Posted by supersole 
Doing a log out
March 03, 2005 11:52AM
Hi,

I just was integrating phorum with another system and reached an strange point where I would know if the only way of finishing a session in phorum is destroying the cookie it sets. I mean, it seems like this works in my tests but it could be cool to listen opinions from the phorum developers.

Also I would like to know why the phorum cookie has that big timeout instead of making the cookie last only for the current browser session - so the cookie gets destroyed when the user closes the browser, and next time he opens the phorum page again he won't find the phorum with a pre-logged user, which is not nice if that's a shared computer. (I think we can't hope that a user reminds to log out each time he is going to close the browser)

What I did is change the timeout with a 0 value, so then the cookie gets destroyed automatically. But once again, I would like to know developers opinion about that. You know better than me how it was built and the reasons for doing it that way.

Thank you very much for the effort and the phorum.
Re: Doing a log out
March 03, 2005 04:49PM
> I just was integrating phorum with another system
> and reached an strange point where I would know if
> the only way of finishing a session in phorum is
> destroying the cookie it sets. I mean, it seems
> like this works in my tests but it could be cool
> to listen opinions from the phorum developers.

If you destroy the cookie, they are logged out.

> Also I would like to know why the phorum cookie
> has that big timeout instead of making the cookie
> last only for the current browser session - so the
> cookie gets destroyed when the user closes the
> browser, and next time he opens the phorum page
> again he won't find the phorum with a pre-logged
> user, which is not nice if that's a shared
> computer. (I think we can't hope that a user
> reminds to log out each time he is going to close
> the browser)

That is an admin configuration option. Set it to whatever you want. 0 is browser session.



Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Doing a log out
March 04, 2005 11:21AM
Well, what was making me doubt about that setting is that even if I set it to 0 in the admin settings, it will be added a day (something like + 86400 seconds) in the actual calculus so it didn't seem very reliable for me to trust the admin setting.

That's why I was asking you if that was a good idea or not, or if I was missing something.

Thank you so much for your FAST answer!
Re: Doing a log out
March 04, 2005 11:25AM
no, it doesn't:
            if($session_cookie || $PHORUM["session_timeout"]==0){
                $timeout = 0;
            } else {
                $timeout = time() + 86400 * $PHORUM["session_timeout"];
            }



Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Doing a log out
March 04, 2005 11:34AM
oh sorry, you're right... too many things in my head :)
Sorry, only registered users may post in this forum.

Click here to login