Ticket #660 (closed Bug: fixed)

Opened 5 months ago

Last modified 4 months ago

Explicitly calling Session::create() alternately re-creates and destroys session

Reported by: edam Owned by: Shadowhand
Priority: minor Milestone: 2.2
Component: Libraries:Session Version: SVN HEAD
Keywords: Cc:

Description

With a clean installation of SVN head's trunk and the following code in application/controllers/welcome.php:

class Welcome_Controller extends Controller {
        public function __construct() {
                $this->session = new Session;
        }
        public function index() {
                $this->session->create();
        }
}

and application/config/session.php's driver set to "database", the following behaviour can be observed:

First request:

  • a new session is created in the database's session table
  • a cookie is returned to the browser with the correct session id

Second request:

  • the previous session's cookie is destroyed
  • a new session is NOT created in the database
  • a new cookie is NOT given to the browser
  • At this point there is no session!

Further requests produce exactly the same results as the first and second alternately.

Change History

Changed 5 months ago by Shadowhand

  • owner changed from - No owner - to Shadowhand
  • status changed from new to assigned

Changed 5 months ago by Shadowhand

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone changed from 2.1.3 to 2.2

Fixed in r2994.

Changed 4 months ago by Shadowhand

A further fix to regenerate() was applied in r3079.

Note: See TracTickets for help on using tickets.