Page 3 of 3

Re: Working with session and post form variables

Posted: Thu Apr 23, 2015 10:09 am
by T0ny
Yes, you have to call session_start() before the request class is instantiated. e.g.

Code: Select all

<?php

session_start(); // WORKS HERE

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);


// session_start(); // WON'T WORK HERE


// start phpbb session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();



if (isset($_SESSION['T']))
{
	echo('SESSION VAR: ' . $_SESSION['T'] . '<br />');
}

$_SESSION['T'] = 'TEST SESSION SET';


Re: Working with session and post form variables

Posted: Thu Apr 23, 2015 11:04 am
by MKULTRA
Sorry, I tested that and it did not work. Sessions are being killed or unset within a function pertaining to includes/compatibility_globals.php I checked through sessions.php and did not find anything in there that was helpful either.

Re: Working with session and post form variables

Posted: Mon Sep 05, 2016 8:30 pm
by 135
If anybody try to found solution for access to $_SESSION as I am also...
Don't lost your time. You have just two ways:
1.$request->enable_super_globals(); before use standard php session management (session_start() etc.)
2. Use Symfony session management http://symfony.com/doc/current/componen ... sions.html

No other ways.
Any attempts to add $_SESSION support to phpbb code will be fail because source more deeper - in the Symfony.