Web based family history software

This Help forum is for issues relates to the latest release (1.1.x). For issues related to beta or svn version please use their own Help forum.
When requesting help please provide as much information as possible. Explain what version of webtrees, PHP and MYSQL you are using. If possible provide a URL to your site so we can see the problem first-hand.
Tip: Think about putting these details in your signature, so it appears in the footer of ALL your messages

Question Explicit logout

More
12 years 11 months ago - 12 years 11 months ago #1 by Rolf
Explicit logout was created by Rolf
Hi everybody
Explicit logout (click on logout link) doesn't always work in webtrees.
I have looked in the Log in the administration section, and there IS an entry, that the user has logged out,
but in the "Logged in users block", this user is still shown.
Is this issue known?
Best regards, Rolf

PS, Not connected to the above:
It would be nice to have a function in admin section to explicitly run the "session timeout collector".

Rolf
www.familienstamm.ch
Using: webtrees 2.0.19, PHP 7.4.25
Last edit: 12 years 11 months ago by Rolf.

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #2 by fisharebest
Replied by fisharebest on topic Re: Explicit logout
<<Explicit logout (click on logout link) doesn't always work in webtrees.>>

Doesn't always work? Intermittent bugs are always difficult to diagnose - especially when they don't happen on your development server. Is there any pattern? How infrequently?

<<Is this issue known?>>

The logged-in-users block does not work at all, on sites that have installed the APC accelerator.

This is because APC is clashing with the user/custom session-handler, so we currently revert to the default (usually file-based session handler). The logged-in user block still checks the wt_session table, which is then no longer updated.

<<It would be nice to have a function in admin section to explicitly run the "session timeout collector". >>

The "session garbage collection" is controlled by PHP, rather than the application. The application provides the code, but the PHP server decides when to call it.

One of our users had recently configured his server to never run the cleanup. Others have set it to clean up far too infrequently (e.g. every 10000 page requests, on a lightly used site). Check your gc_probability and gc_divisor values in your PHP-information page.

However, I wouldn't support such a feature. If there is a problem with old sessions not being cleaned up, then we need to deal with the problem - not hide the symptoms of it.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #3 by Rolf
Replied by Rolf on topic Re: Explicit logout
I think I found the reason, why it seemd not to work:

The users, where the logout didn't seem to work, had an rather old session which was not closed - nor explicit, nor by timeout (not until now).

When they logged in next time (may be on another machine), webtrees created a new session, but the logged-in-box shows the user only once (it sorts the duplicates out).
When they logged out (second session), it closed the second session, but left the first one open, still showing the user on the logged-in-box.

So in reality, the explicit logout works correct!
The only issue is, that the session garbage collector fires so rarely (on my site).

The PHP-Values for gc_probability is 1, gc_divisor is 1000.
I read the forum thread "Logout", where you explained the timeout collector.
I guess, it would be a good option to lower the gc_divisor to 100 or to 10, as long as I have a low visit rate on the site (currently still closed for public), and to increase it, when the visits increase.

Would it be a good idea to setting up a cron job for garbage collection, instead of temper with the PHP-Values?
Best regards, Rolf

Rolf
www.familienstamm.ch
Using: webtrees 2.0.19, PHP 7.4.25

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago - 12 years 11 months ago #4 by kiwi
Replied by kiwi on topic Re: Explicit logout

Would it be a good idea to setting up a cron job for garbage collection, instead of temper with the PHP-Values?

Keep it simple, just change the gc_divisor to 100. Cron jobs just add complexity - I saw one site that had a dozen running, some at the same time! It can easily get out of hand. Who knows how long it will be before the 100 setting is not right. It might be years, and in the meantime you can almost forget the issue once its at 100.
Last edit: 12 years 11 months ago by kiwi.

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #5 by Rolf
Replied by Rolf on topic Re: Explicit logout
Again, things are clearer now, and this issue is solved, by setting the gc_divisor to 100.
On the same occaison, I switched PHP from 5.2.14 to 5.3.3.

I would like to say a big "thank's a lot!" to all of you, who spend your time here for helping me and others!
With this, a product like webtrees really makes fun :-D
Best regards, Rolf

Rolf
www.familienstamm.ch
Using: webtrees 2.0.19, PHP 7.4.25

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}