Don't start a PHP session unnecessarily (breaks Varnish caching)

Created on 18 June 2020, over 4 years ago
Updated 24 December 2024, 27 days ago

Problem/Motivation

Visiting any page results in a new session by default making it difficult to work with web accelerators like Varnish etc.

edit: I think it might also be the cause of the PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ... UPDATE {sessions} ... error when $conf[https] = TRUE; is set.

Proposed resolution

Start the temporary session only when the user is IP restricted, and not before.
And leave the drupal_session_start() triggering behaviour to Drupal.

Alternatively, couldn't we just set drupal_page_is_cacheable(TRUE); and be done, removing the need for the temporary session?

Remaining tasks

Create patch for new behaviour.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024