bl-kernel session bug/fix
Posted: Thu Aug 27, 2026 3:22 am
I read in bl-kernel/helpers/session.class.php [Bludit ver 3.22]
Yes.
Then a bit further down...
session_name('__Secure-BLUDIT-KEY'); does not exist in ver. 3.15 !!
I imagine you might have noticed my other posts – mostly around the dis-function of my imageManager plugin. So, now I have nailed down the actual culprit; clearly not a bug BUT ........ how to work around this when using ajax?
I tried in *ajax.php using:
And it works fine for 3.22 BUT not for 3.15
When was __Secure-BLUDIT-KEY introduced?
Which version?
While it is a fuzzy hack I can test for version number along with !empty($_SERVER['HTTPS']). I haven't tested this yet but am pretty sure it will work.
What is a better, cleaner way to work around this version change? please...
Code: Select all
private static $sessionName = 'BLUDIT-KEY';Yes.
Then a bit further down...
Code: Select all
public static function start($path, $secure) { ....
// Sets the session name to the one set above.
// [b]Use the __Secure- prefix[/b] when served over HTTPS to prevent cookie hijacking.
$sessionName = $secure ? '__Secure-' . self::$sessionName : self::$sessionName;
session_name($sessionName);
I imagine you might have noticed my other posts – mostly around the dis-function of my imageManager plugin. So, now I have nailed down the actual culprit; clearly not a bug BUT ........ how to work around this when using ajax?
I tried in *ajax.php using:
Code: Select all
$secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
if ($secure) {
session_name('__Secure-BLUDIT-KEY'); // see: ./bl-kernel/boot/inti.php
} else {
session_name('BLUDIT-KEY');
}
session_start();When was __Secure-BLUDIT-KEY introduced?
Which version?
While it is a fuzzy hack I can test for version number along with !empty($_SERVER['HTTPS']). I haven't tested this yet but am pretty sure it will work.
What is a better, cleaner way to work around this version change? please...