Close session for writing after changes are made to improve performance during computationally expensive tasks

This commit is contained in:
Junior 2026-11-08 15:56:55 -05:00
parent 7b186c1898
commit 596148f4bb
3 changed files with 3 additions and 0 deletions

View File

@ -41,6 +41,7 @@ if ( !is_dir($fullcompath) ) {
$_SESSION['compath'] = $compath; $_SESSION['compath'] = $compath;
setcookie("compath", $compath, time()+31536000, "/", "jaj.com", true); setcookie("compath", $compath, time()+31536000, "/", "jaj.com", true);
} }
session_write_close();
// Build up a list of comics and issues which have been read in descending order by lastupdate // Build up a list of comics and issues which have been read in descending order by lastupdate
$query = "SELECT comic, issue FROM pagetracker WHERE username=:username"; $query = "SELECT comic, issue FROM pagetracker WHERE username=:username";

View File

@ -1,6 +1,7 @@
<?php <?php
require '../header.php'; require '../header.php';
session_write_close();
$validated = require_login(NOREDIRECT); $validated = require_login(NOREDIRECT);
$data = array(); $data = array();

View File

@ -32,6 +32,7 @@ if ( isset($_REQUEST['comic']) ) {
$ext = strtolower(substr($comicfull, -3)); $ext = strtolower(substr($comicfull, -3));
$_SESSION['comfile'] = basename($comicfull); $_SESSION['comfile'] = basename($comicfull);
session_write_close();
// Get the current page for this comic or 0 (zero) if never opened // Get the current page for this comic or 0 (zero) if never opened
$query = "SELECT currentpage FROM pagetracker WHERE username=:username AND issue=:issue"; $query = "SELECT currentpage FROM pagetracker WHERE username=:username AND issue=:issue";