-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: bug 4.4.4 spark serve
not working when using Session in Routes.php
#8389
Conversation
After upgrading 4.4.3 to 4.4.4 a bug are coming, spark not launching the CI with cmd. php spark server* Error log: Undefined global variable $_SESSION at SYSTEMPATH\Session\Session.php:499 Backtrace: 1 SYSTEMPATH\Session\Session.php:499 CodeIgniter\Debug\Exceptions()->errorHandler(2, 'Undefined global variable $_SESSION', 'C:\\wamp64\\www\\system\\Session\\Session.php', 499) My fix working with no errors and launching correctly CI.
bug fix
I have confirmed this. --- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -6,3 +6,4 @@ use CodeIgniter\Router\RouteCollection;
* @var RouteCollection $routes
*/
$routes->get('/', 'Home::index');
+session('rank'); $ ./spark serve
CodeIgniter v4.4.4 Command Line Tool - Server Time: 2023-12-30 08:09:27 UTC+00:00
[ErrorException]
Undefined global variable $_SESSION
at SYSTEMPATH/Session/Session.php:499
Backtrace:
1 SYSTEMPATH/Session/Session.php:499
CodeIgniter\Debug\Exceptions()->errorHandler(2, 'Undefined global variable $_SESSION', '/Users/kenji/work/codeigniter/official/CodeIgniter4/system/Session/Session.php', 499)
2 SYSTEMPATH/Common.php:986
CodeIgniter\Session\Session()->get('rank')
3 APPPATH/Config/Routes.php:9
session('rank')
4 SYSTEMPATH/Router/RouteCollection.php:344
require('/Users/kenji/work/codeigniter/official/CodeIgniter4/app/Config/Routes.php')
5 SYSTEMPATH/CLI/Console.php:39
CodeIgniter\Router\RouteCollection()->loadRoutes()
6 ROOTPATH/spark:102
CodeIgniter\CLI\Console()->run() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
spark serve
not working when using Session in Routes.php
Thank you @ALTITUDE-DEV-FR |
Happy to help with my favorite PHP framework ;) |
@kenjis I have also this problem, but with inserting data to database with queue library, when to expect v4.4.5? Now I need to downgrade to v4.4.3 |
spark serve
not working when using Session in Routes.phpspark serve
not working when using Session in Routes.php
After upgrading 4.4.3 to 4.4.4 a bug are coming, spark not launching the CI with cmd. php spark server*
Error log:
Undefined global variable $_SESSION
at SYSTEMPATH\Session\Session.php:499
Backtrace:
1 SYSTEMPATH\Session\Session.php:499
CodeIgniter\Debug\Exceptions()->errorHandler(2, 'Undefined global variable $_SESSION', 'C:\wamp64\www\system\Session\Session.php', 499)
My fix working with no errors and launching correctly CI.
Description
Explain what you have changed, and why.
Checklist: