Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Removes setting session params, moves output buffer clean

AuthorDaveJarvis <email>
Date2023-11-09 00:41:18 GMT-0800
Commitd9d08a55ae85c40979f1d940ced006c01c28742d
Parent34f04e5
Delta2 lines added, 16 lines removed, 14-line decrease
www/downloads/counter.php
ini_set( 'error_log', '/tmp/php-errors.log' );
- // Prevent session hijacking.
- ini_set( 'session.cookie_httponly', 1 );
-
- // Prevent session fixation.
- ini_set( 'session.use_only_cookies', 1 );
-
- // Force setting secure cookies.
- ini_set( 'session.cookie_secure', 1 );
-
- // Allow setting session variables (cookies).
- if( session_id() === PHP_SESSION_NONE ) {
- session_start();
+ if( ob_get_level() > 0 ) {
+ ob_end_clean();
}
$range_bytes = $seek_start . '-' . $seek_end . '/' . $size;
-
- if( ob_get_level() > 0 ) {
- ob_end_clean();
- }
header( 'Accept-Ranges: bytes' );