Skip to content

Only start session if hasn't already been started#2392

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

Only start session if hasn't already been started#2392
dwightwatson wants to merge 1 commit intobcit-ci:developfrom
dwightwatson:develop

Conversation

@dwightwatson
Copy link
Copy Markdown

On 3.0-dev I get a notice warning that a session has already been started, even though the only call to session_start() in the app is the one in the Session_native.php file.

This will only call session_start() if the session does not exist, to prevent a warning.

Signed-off-by: Dwight Watson dwight@studentservices.com.au

Signed-off-by: Dwight Watson <dwight@studentservices.com.au>
@AkenRoberts
Copy link
Copy Markdown
Contributor

I have never seen this warning. Can you give more information about your PHP environment, and the exact warning text?

@dwightwatson
Copy link
Copy Markdown
Author

This is the error that I get:

A PHP Error was encountered

Severity: Notice

Message: A session had already been started - ignoring session_start()

Filename: drivers/Session_native.php

Line Number: 113

Backtrace:

File: /nfs/c09/h01/mnt/128773/domains/timetableexchange.com/application/core/MY_Controller.php
Line: 66
Function: __construct

File: /nfs/c09/h01/mnt/128773/domains/timetableexchange.com/html/index.php
Line: 277
Function: require_once

The __construct() function in MY_Controller simply calls parent::__construct() and then loads a model. Running PHP 5.3.15 (Media Temple (gs)).

@narfbg
Copy link
Copy Markdown
Contributor

narfbg commented Apr 8, 2013

Please see #2374 and the comments on it.

@narfbg narfbg closed this Apr 8, 2013
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.

3 participants