Welcome Guest, Not a member yet? Register   Sign In
Codeignitor error while following login tutorial
#1

I followed this tutorial {http://www.iluv2code.com/login-with-codeigniter-php.html} to make a login page in codeigniter.
My codeigniter version is 3.1.0. I am using wamp server.I am getting error as 

**1st error**

    A PHP Error was encountered
    
    Severity: Warning
    
    Message: ini_set() [function.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:\wamp\www\ci\application\controllers\home.php
    Line: 7
    Function: __construct
    
    File: C:\wamp\www\ci\index.php
    Line: 315
    Function: require_once

**2nd error**

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: A session had already been started - ignoring session_start()
    
    Filename: Session/Session.php
    
    Line Number: 141
    
    Backtrace:
    
    File: `C:\wamp\www\ci\application\controllers\home.php`
    Line: 7
    Function: __construct
    
    File: `C:\wamp\www\ci\index.php`
    Line: 315
    Function: require_once


My line 315 in index.php is
require_once BASEPATH.'core/CodeIgniter.php';
but there is no file CodeIgniter.php under core folder.
Reply
#2

You need to comment this line in controller/home.php
PHP Code:
// session_start(); //we need to call PHP's session object to access it through CI 

That tutorial was written for CI 2.x, if you are running into issues please check the upgrade guide to 3.0
Reply




Theme © iAndrew 2016 - Forum software by © MyBB