Comments (7)
Here is the trace:
#0 MyProject\App->allThrowErrorHandler(2, ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time, D:\dev\wamp2.2\www\MyProject\lib\vendor\aura\session\src\Phpfunc.php, 33, Array ([func] => ini_set,[args] => Array ([0] => session.use_trans_sid,[1] => 0)))
#1 ini_set(session.use_trans_sid, 0)
#2 call_user_func_array(ini_set, Array ([0] => session.use_trans_sid,[1] => 0)) called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\aura\session\src\Phpfunc.php:33]
#3 Aura\Session\Phpfunc->__call(ini_set, Array ([0] => session.use_trans_sid,[1] => 0))
#4 Aura\Session\Phpfunc->ini_set(session.use_trans_sid, 0) called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\aura\session\src\Session.php:260]
#5 Aura\Session\Session->sessionStatus() called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\aura\session\src\Session.php:228]
#6 Aura\Session\Session->isStarted() called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\aura\session\src\Segment.php:227]
#7 Aura\Session\Segment->resumeSession() called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\aura\session\src\Segment.php:66]
#8 Aura\Session\Segment->get(member_id) called at [D:\dev\wamp2.2\www\MyProject\app\App.php:136]
#9 MyProject\App->isLogged() called at [D:\dev\wamp2.2\www\MyProject\app\controller\AController.php:77]
#10 MyProject\Controller\AController->needLogged() called at [D:\dev\wamp2.2\www\MyProject\app\controller\AController.php:339]
#11 MyProject\Controller\AController::__callStatic(route_homepage, Array ())
#12 MyProject\Controller\MainController::route_homepage() called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\mikecao\flight\flight\core\Dispatcher.php:197]
#13 flight\core\Dispatcher::invokeMethod(Array ([0] => MyProject\Controller\MainController,[1] => route_homepage), Array ()) called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\mikecao\flight\flight\core\Dispatcher.php:142]
#14 flight\core\Dispatcher::execute(Array ([0] => MyProject\Controller\MainController,[1] => route_homepage), Array ()) called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\mikecao\flight\flight\Engine.php:313]
#15 flight\Engine->_start() called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\mikecao\flight\flight\core\Dispatcher.php:196]
#16 flight\core\Dispatcher::invokeMethod([long params]) called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\mikecao\flight\flight\core\Dispatcher.php:142]
#17 flight\core\Dispatcher::execute([long params]) called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\mikecao\flight\flight\core\Dispatcher.php:48]
#18 flight\core\Dispatcher->run(start, Array ()) called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\mikecao\flight\flight\Engine.php:64]
#19 flight\Engine->__call(start, Array ())
#20 flight\Engine->start() called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\mikecao\flight\flight\core\Dispatcher.php:196]
#21 flight\core\Dispatcher::invokeMethod([long params]) called at [D:\dev\wamp2.2\www\MyProject\lib\vendor\mikecao\flight\flight\Flight.php:76]
#22 Flight::__callStatic(start, Array ())
#23 Flight::start() called at [D:\dev\wamp2.2\www\MyProject\app\App.php:118]
#24 MyProject\App->route() called at [D:\dev\wamp2.2\www\MyProject\public\webapp.php:81]
I suspect it is due to how Flight handles the session or something, because it only emits a warning after I have called Flight::start()
.
Should I be on the lookout for something in particular? Like a session_start or something, maybe? Anyway I obviously need to be able to use the session after the call to AController::__callStatic(route_***)
, but it seems to bug at this moment.
from aura.session.
By the way, I am using PHP 5.3.13.
For now, I am simply ignoring the error in my error handler (by testing the error message with strpos), but I'd love to understand the bottom of it and do things properly... :)
from aura.session.
Hi,
This is actually a work around to see if the session is started in 5.3 . See
Lines 225 to 229 in b24aed6
As you mentioned it is already written here
Lines 240 to 254 in b24aed6
Regarding the error reported : I have tested via https://3v4l.org/5LtnA and https://3v4l.org/PdqkL .
The first one is disabling the error_report and the 2nd one is without disabling the error. You can see the first one have not reported any errors and works perfectly as expected. So your case is 2nd one.
I am not sure what is the problem though in your system.
Could you just try this
<?php
session_start();
$setting = 'session.use_trans_sid';
$current = ini_get($setting);
$level = error_reporting(0);
$result = ini_set($setting, $current);
error_reporting($level);
var_dump($result !== $current);
My assumption is the error_reporting is not getting turned off even after it is called.
Thank you.
from aura.session.
Hi,
It works.
But try that one:
<?php
session_start();
$setting = 'session.use_trans_sid';
$current = ini_get($setting);
$level = error_reporting(0);
$result = ini_set($setting, $current);
error_reporting($level);
echo 'test1<br>';
var_dump($result !== $current);
function toto($errNo, $errStr, $errFile, $errLine)
{
die('erreur detected: ' . $errNo . ' // ' . $errStr . ' // ' . $errFile . ' // ' . $errLine);
}
set_error_handler('toto');
$setting = 'session.use_trans_sid';
$current = ini_get($setting);
$level = error_reporting(0);
$result = ini_set($setting, $current);
error_reporting($level);
echo 'test2<br>';
var_dump($result !== $current);
die('end');
This is my code (well, kindof), and it fails (it dies).
from aura.session.
Hm...
That actually brings me to here :
error_reporting() settings will have no effect and your error handler will be called regardless
http://php.net/set_error_handler
We may want to fix something in that case... But there is a but for php 5.3 already is EOL . So do we really need to spend the time to fix ? I guess there will be less users effected with this though. I know that may be a bit hard for you. Sorry :-( .
If you have any fix, please do send the same. I will also look if we can fix it by some means.
Thank you
from aura.session.
Don't apologize to me, I totally understand. I work on a project for a client who is not capable of installing a newer PHP version on a brand new server (lazy people...). It causes me troubles, obviously, but it is my burden to bear.
I'll just ignore the error in my handler, and it will be ok. As for a fix in the lib itself, I really don't know and I agree that you shouldn't care about PHP 5.3!
Thanks for a very nice lib :)
from aura.session.
@RenaudParis
I really don't know and I agree that you shouldn't care about PHP 5.3!
I understand :-) .
from aura.session.
Related Issues (20)
- Releases HOT 1
- PHP7 session_regenerate_id(): Failed to create(read) session ID: user (path: ) HOT 5
- Can you please tell me what kind of encryption do you use to store data? HOT 4
- Feature Request - getOnce? HOT 2
- Cookie Params HOT 4
- SessionHeadersHandler and session.use_cookies issue HOT 1
- Questions HOT 1
- Segment not saving values HOT 5
- Can not set the session_name or session_params with PHP 7.2 HOT 3
- getFlash doesn't fetch flash session data set via setFlash in previous request HOT 3
- Session lifetime is ignored HOT 3
- Flash messages not working in MVC layout? HOT 2
- Future of this project
- aura session segment error HOT 1
- 4.x branch HOT 4
- Move interfaces
- Latest stable release? HOT 2
- Access Session from Different Domains HOT 1
- Re: Stable version 4 release date HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aura.session.