Skip to content

[ticket/17656] Add shorter guest session length and new AI bots#6960

Open
marc1706 wants to merge 7 commits into
phpbb:masterfrom
marc1706:ticket/17656
Open

[ticket/17656] Add shorter guest session length and new AI bots#6960
marc1706 wants to merge 7 commits into
phpbb:masterfrom
marc1706:ticket/17656

Conversation

@marc1706
Copy link
Copy Markdown
Member

@marc1706 marc1706 commented May 18, 2026

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17656

@marc1706 marc1706 added this to the 3.3.17 milestone May 18, 2026
Comment thread phpBB/language/en/acp/board.php Outdated
public function add_bots(): void
{
$bots = [
// 'BotName' => 'Agent partial name',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, opposed to search bots leading traffic to my site, I don't think I want to have these bots in the same category since they copy contents, train their datasets and consume resources without contributing to anyrhing useful.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean with leading traffic to your site? This will cause these to show up as Bots visiting your site and the bots will see less user-specific links and therefore should be less likely to crawl useless links or sites.

'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int:0:999', 'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'legend1' => 'GENERAL_SETTINGS',
'limit_load' => array('lang' => 'LIMIT_LOAD', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int:60:9999999999', 'type' => 'number:60:9999999999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use fool proof max values here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default is 3600, not sure what a sensible max length would be :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other settings we use 99.999 minutes e.g. for time span for post edits. So roughly 70 days.

I would use here like a maximum of 1 day, ca. 80k to 99k seconds.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a dedicated, shorter lifecycle for anonymous (guest) sessions and expands the built-in bot list to include common AI crawlers, aiming to reduce session table growth and improve handling of modern crawler traffic.

Changes:

  • Add guest-only session GC (session_guest_gc()) and a new cron task to run it on an independent (tighter) schedule.
  • Add new configuration options (and ACP UI strings/fields) for guest session length/GC interval, plus install-time defaults.
  • Add a migration to create AI crawler bot users and bot-agent entries.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
phpBB/phpbb/session.php Adds a new session_guest_gc() method to delete expired anonymous sessions and update a dedicated last-run timestamp.
phpBB/phpbb/db/migration/data/v33x/guest_session_config.php Adds new guest session config keys and introduces a new sessions-table index to support guest session operations.
phpBB/phpbb/db/migration/data/v33x/ai_crawler_bots.php Adds a migration to create multiple AI crawler bot accounts and bot-agent entries.
phpBB/phpbb/cron/task/core/tidy_guest_sessions.php Introduces a new cron task that runs guest-only session cleanup based on new config intervals.
phpBB/language/en/acp/board.php Adds ACP language strings for the new session GC/guest session settings.
phpBB/install/schemas/schema_data.sql Seeds default values for the new guest session settings (and dynamic last-run key) on fresh installs.
phpBB/includes/acp/acp_board.php Exposes session GC and new guest session settings in the ACP “Load Settings” section.
phpBB/config/default/container/services_cron.yml Registers the new cron task service for guest session cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread phpBB/phpbb/cron/task/core/tidy_guest_sessions.php
Comment thread phpBB/phpbb/db/migration/data/v33x/guest_session_config.php Outdated
Comment thread phpBB/phpbb/db/migration/data/v33x/guest_session_config.php Outdated
Comment thread phpBB/language/en/acp/board.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants