It looks like you're new here. If you want to get involved, click one of these buttons!
I guess this is a codeigniter bug which suggests adding session_start() before loading the session library $this->load->library('session');
A PHP Error was encountered
Severity: Warning
Message: ini_set(): A session is active. You cannot change the session module's ini settings at this time
Filename: Session/Session.php
Line Number: 316
But I keep getting -
if(function_exists(session_status)){
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
}else{
if(session_id() == '') {
session_start();
}
}
Message: A session had already been started - ignoring session_start()Could you suggest a solution for this?
Comments
Any luck here..
The issues started showing up once I have added modules - custom models for data. Then the home page started showing session error that I have mentioned above.
Extremely sorry for the delayed response, as I had some deployments lined up!
I tried commenting each one of the modules but still not able to figure out what was causing the session error to popup.
I tried to work-around the issue by creating a function which check whether the session is already set! I added the above function in Also introduced the check on line 143 In the same file at line 316, I resolved or rather suppressed the error by commenting out line 316 I am not sure if the above commented line will have any adverse effects! I would like to know if I should go ahead this way. The above mentioned actions sorted the session related issues.
Shows only with logged user (admin, and other ones created), in development mode.
Steps performed:
- installed fresh fuel-cms v1.4.2
- installed mysql database, created user, installed sql schema
- modified fuel/application/config/database.php for sql access
- modified fuel/application/config/MY_fuel.php :
$config['admin_enabled'] = TRUE;
$config['fuel_mode'] = 'auto';
$config['language_mode'] = 'segment';
- added to fuel/application/config/MY_fuel.php language configuration setting:
$config['settings'] = array();
$config['settings']['languages'] = array(
'type' => 'keyval',
'fields' => array(
'key' => array('ignore_representative' => TRUE),
'label' => array('ignore_representative' => TRUE),
),
'class' => 'repeatable',
'repeatable' => TRUE,
'ignore_representative' => TRUE
);
- logged in fuel cms
- set fuel language settings:
pl:Polski
en:English
- created 'home' page, with different page titles to see the difference between language versions
- added agressive redirects:
$config['case_sensitive'] = FALSE;
$config['aggressive_redirects'] = array(
'pl' => '/',
'home' => '/',
'pl/home' => '/',
'en/home' => 'en',
);
Redirects works ok, but page spits warnings, also fuel inline control box doesn't show buttons and laguage select.
---
PHP Error was encountered
Severity: Warning
Message: ini_set(): A session is active. You cannot change the session module's ini settings at this time
Filename: Session/Session.php
Line Number: 314
Backtrace:
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 791
Function: __construct
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 684
Function: _ci_init_library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 538
Function: _ci_load_stock_library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 592
Function: _ci_load_library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 198
Function: _ci_load_library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_auth.php
Line: 137
Function: library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_auth.php
Line: 473
Function: valid_user
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_auth.php
Line: 324
Function: is_super_admin
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_pages.php
Line: 1292
Function: has_permission
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_pages.php
Line: 1402
Function: render_marker
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_pages.php
Line: 1388
Function: preg_replace_callback
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_pages.php
Line: 1193
Function: render_all_markers
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\controllers\Page_router.php
Line: 137
Function: fuelify
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\controllers\Page_router.php
Line: 84
Function: _remap_cms
File: C:\xampp\htdocs\fuel-test\index.php
Line: 364
Function: require_once
A PHP Error was encountered
Severity: Notice
Message: A session had already been started - ignoring session_start()
Filename: Session/Session.php
Line Number: 143
Backtrace:
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 791
Function: __construct
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 684
Function: _ci_init_library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 538
Function: _ci_load_stock_library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 592
Function: _ci_load_library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\core\Loader.php
Line: 198
Function: _ci_load_library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_auth.php
Line: 137
Function: library
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_auth.php
Line: 473
Function: valid_user
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_auth.php
Line: 324
Function: is_super_admin
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_pages.php
Line: 1292
Function: has_permission
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_pages.php
Line: 1402
Function: render_marker
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_pages.php
Line: 1388
Function: preg_replace_callback
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_pages.php
Line: 1193
Function: render_all_markers
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\controllers\Page_router.php
Line: 137
Function: fuelify
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\controllers\Page_router.php
Line: 84
Function: _remap_cms
File: C:\xampp\htdocs\fuel-test\index.php
Line: 364
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\fuel-test\fuel\codeigniter\core\Exceptions.php:271)
Filename: core/Input.php
Line Number: 408
Backtrace:
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_language.php
Line: 395
Function: set_cookie
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_language.php
Line: 163
Function: set_cookie
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_language.php
Line: 344
Function: set_selected
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_admin.php
Line: 1401
Function: detect
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\libraries\Fuel_pages.php
Line: 1212
Function: toolbar
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\controllers\Page_router.php
Line: 137
Function: fuelify
File: C:\xampp\htdocs\fuel-test\fuel\modules\fuel\controllers\Page_router.php
Line: 84
Function: _remap_cms
File: C:\xampp\htdocs\fuel-test\index.php
Line: 364
Function: require_once
---
Can someone share a suggestion for better redirecting of fuel created pages ?
For now, i need to redirect these 4 unnecesary links (routed by fuel-cms) to '/' (domain home page) and '/en' for english version of page.
But now I realized that for every polish page 'something' i will be having it also under 'pl/something' link, uhhhh....
Anyways I fixed my needs with .htaccess entries :
# default language redirects
RewriteRule ^pl$ $1 [L,R=301]
RewriteRule ^pl/(.*)? $1 [L,R=301]
RewriteRule ^pl/home/(.*)? $1 [L,R=301]
RewriteRule ^home/? $1 [L,R=301]
RewriteRule ^en/home? en/ [L,R=301]
# Allow asset folders through ...
It can be usefull for someone who needs multi-language pages in Fuel-CMS and it should be be now properly indexed by search engines (fixes duplicate website content issue). (I hope
One need just put default language segment instead of 'pl' and add other(s) used language segment(s) instead of 'en' (each {ln}/home entry for each used language except default one).