Skip to content

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

Open
marc1706 wants to merge 11 commits into
phpbb:3.3.xfrom
marc1706:ticket/17656
Open

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

Conversation

@marc1706

@marc1706 marc1706 commented May 18, 2026

Copy link
Copy Markdown
Member

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.

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.

You could even ban them if you don't like them based on this :)

Comment thread phpBB/includes/acp/acp_board.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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
@marc1706 marc1706 modified the milestones: 3.3.17, 3.3.18 Jun 6, 2026
@marc1706
marc1706 changed the base branch from master to 3.3.x July 7, 2026 19:15
@marc1706 marc1706 closed this Jul 7, 2026
@marc1706 marc1706 reopened this Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

The attempt to merge branch 3.3.x into master has completed after considering the changes in this PR.

  • Merge result: Conflict ❌

A separate PR will be needed to merge 3.3.x into master.

@marc1706
marc1706 requested a review from Derky July 17, 2026 15:47
Comment thread phpBB/install/schemas/schema_data.sql Outdated
Comment thread phpBB/phpbb/db/migration/data/v33x/add_ai_crawlers_group.php Outdated
Comment thread phpBB/phpbb/db/migration/data/v33x/add_ai_crawlers_group.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.

5 participants