Welcome Guest, Not a member yet? Register   Sign In
Cannot disable CI Session handling in v4.5.1
#1

(This post was last modified: 06-04-2024, 09:47 AM by codeus.)

After reading the userguide (excerpt below), I believe this is a bug-:

Quote: Wrote:This was due to the specifics of how sessions worked, but is now no longer necessary with our new implementation. However, it may happen that your application relied on these values, so here are alternative methods of accessing them:

session_id: $session->session_id or session_id() (PHP’s built-in function)


Before v4.3.0, the session configuration was held in Config/App.php. Now Config/Session.php holds the session configuration. There is nothing in Config/Session.php to indicate how to turn off CI session handling. Looking at the CI code appears to confirm this.

How to reproduce:
# Setup new CI v4.5.1 with composer
# In BaseController, add session_start()

PHP Code:
Code:
    public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
    {
        // Do Not Edit This Line
        parent::initController($request, $response, $logger);
        session_start();
    }

# Then browse to site's home page. Exception is thrown in FileHandler-:
SYSTEMPATH/Session/Handlers/FileHandler.php at line 74
Code:
Code:
68   public function __construct(SessionConfig $config, string $ipAddress)
69     {
70         parent::__construct($config, $ipAddress);
71
72         if (! empty($this->savePath)) {
73             $this->savePath = rtrim($this->savePath, '/\\');
74             ini_set('session.save_path', $this->savePath);
75         } else {
76             $sessionPath = rtrim(ini_get('session.save_path'), '/\\');
77
78             if ($sessionPath === '') {
79                 $sessionPath = WRITEPATH . 'session';
80             }
Reply


Messages In This Thread
Cannot disable CI Session handling in v4.5.1 - by codeus - 06-04-2024, 09:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB