Skip to content

Fix PHP notice: a session had already been started#2374

Closed
cweric wants to merge 1 commit intobcit-ci:developfrom
cweric:develop
Closed

Fix PHP notice: a session had already been started#2374
cweric wants to merge 1 commit intobcit-ci:developfrom
cweric:develop

Conversation

@cweric
Copy link
Copy Markdown

@cweric cweric commented Mar 31, 2013

No description provided.

@narfbg
Copy link
Copy Markdown
Contributor

narfbg commented Mar 31, 2013

Either use session_start() manually or CI's Session native driver - don't do both, the driver depends on the assumption that you won't interfere with it and a lot of stuff will break if you do.

@narfbg narfbg closed this Mar 31, 2013
@cweric
Copy link
Copy Markdown
Author

cweric commented Apr 5, 2013

But sometimes involved several libraries together
ex: ./system/libraries/Cart.php
$this->CI->load->driver('session', $config);
and the other libraries have similar session requirement too.
So ./system/libraries/Session/drivers/Session_native.php must handle this.

@narfbg
Copy link
Copy Markdown
Contributor

narfbg commented Apr 5, 2013

Good reasoning, but it's just not the right solution - there should be a way to avoid loading the same session driver twice, and that should depend on CI internals, not PHP's session_*() functions.

@cweric
Copy link
Copy Markdown
Author

cweric commented Apr 5, 2013

OK, are you mean CI Session driver internals?

  1. CI_Session.__construct
  2. CI_Driver_Library.load_driver
  3. CI_Session_driver.decorate
  4. CI_Session_native.initialize
  5. session_start

@narfbg
Copy link
Copy Markdown
Contributor

narfbg commented Apr 8, 2013

Yes, of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants