fix: bug 4.4.4 spark serve not working when using Session in Routes.php#8389
Merged
samsonasik merged 2 commits intocodeigniter4:developfrom Dec 30, 2023
ALTITUDE-DEV-FR:patch-1
Merged
fix: bug 4.4.4 spark serve not working when using Session in Routes.php#8389samsonasik merged 2 commits intocodeigniter4:developfrom ALTITUDE-DEV-FR:patch-1
spark serve not working when using Session in Routes.php#8389samsonasik merged 2 commits intocodeigniter4:developfrom
ALTITUDE-DEV-FR:patch-1
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.
samsonasik
reviewed
Dec 30, 2023
bug fix
Member
|
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() |
spark serve not working when using Session in Routes.php
Member
|
Thank you @ALTITUDE-DEV-FR |
Contributor
Author
Happy to help with my favorite PHP framework ;) |
Contributor
|
@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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: