Unable to locate the specified class: Session.php in Codeigniter 3












1















The browser:



Show Error Message :



Unable to locate the specified class: Session.php



But in other Controllers working fine.
I did move site from Codeigniter 2.x to 3.x.
After that this error occurred.



When I print my session with this $this->session->all_userdata() code the output showing session data.



What I do for resolve this error.










share|improve this question

























  • add your controller code so we can have a look.

    – Kevin
    Nov 10 '17 at 8:06











  • @Kevin I found error i.e. I have called another controller like require('****.php'). the session library called two times in same file.

    – Varinder
    Nov 10 '17 at 8:15













  • You can set in the autoload.php $autoload['libraries'] = array('database', 'session');

    – Anand Pandey
    Nov 10 '17 at 8:19











  • Where is this error show? Means in controller or model?

    – Anand Pandey
    Nov 10 '17 at 8:22











  • @AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.

    – Varinder
    Nov 10 '17 at 8:27
















1















The browser:



Show Error Message :



Unable to locate the specified class: Session.php



But in other Controllers working fine.
I did move site from Codeigniter 2.x to 3.x.
After that this error occurred.



When I print my session with this $this->session->all_userdata() code the output showing session data.



What I do for resolve this error.










share|improve this question

























  • add your controller code so we can have a look.

    – Kevin
    Nov 10 '17 at 8:06











  • @Kevin I found error i.e. I have called another controller like require('****.php'). the session library called two times in same file.

    – Varinder
    Nov 10 '17 at 8:15













  • You can set in the autoload.php $autoload['libraries'] = array('database', 'session');

    – Anand Pandey
    Nov 10 '17 at 8:19











  • Where is this error show? Means in controller or model?

    – Anand Pandey
    Nov 10 '17 at 8:22











  • @AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.

    – Varinder
    Nov 10 '17 at 8:27














1












1








1








The browser:



Show Error Message :



Unable to locate the specified class: Session.php



But in other Controllers working fine.
I did move site from Codeigniter 2.x to 3.x.
After that this error occurred.



When I print my session with this $this->session->all_userdata() code the output showing session data.



What I do for resolve this error.










share|improve this question
















The browser:



Show Error Message :



Unable to locate the specified class: Session.php



But in other Controllers working fine.
I did move site from Codeigniter 2.x to 3.x.
After that this error occurred.



When I print my session with this $this->session->all_userdata() code the output showing session data.



What I do for resolve this error.







php codeigniter session






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 '17 at 8:12









NikuNj Rathod

1,28711120




1,28711120










asked Nov 10 '17 at 7:33









VarinderVarinder

102212




102212













  • add your controller code so we can have a look.

    – Kevin
    Nov 10 '17 at 8:06











  • @Kevin I found error i.e. I have called another controller like require('****.php'). the session library called two times in same file.

    – Varinder
    Nov 10 '17 at 8:15













  • You can set in the autoload.php $autoload['libraries'] = array('database', 'session');

    – Anand Pandey
    Nov 10 '17 at 8:19











  • Where is this error show? Means in controller or model?

    – Anand Pandey
    Nov 10 '17 at 8:22











  • @AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.

    – Varinder
    Nov 10 '17 at 8:27



















  • add your controller code so we can have a look.

    – Kevin
    Nov 10 '17 at 8:06











  • @Kevin I found error i.e. I have called another controller like require('****.php'). the session library called two times in same file.

    – Varinder
    Nov 10 '17 at 8:15













  • You can set in the autoload.php $autoload['libraries'] = array('database', 'session');

    – Anand Pandey
    Nov 10 '17 at 8:19











  • Where is this error show? Means in controller or model?

    – Anand Pandey
    Nov 10 '17 at 8:22











  • @AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.

    – Varinder
    Nov 10 '17 at 8:27

















add your controller code so we can have a look.

– Kevin
Nov 10 '17 at 8:06





add your controller code so we can have a look.

– Kevin
Nov 10 '17 at 8:06













@Kevin I found error i.e. I have called another controller like require('****.php'). the session library called two times in same file.

– Varinder
Nov 10 '17 at 8:15







@Kevin I found error i.e. I have called another controller like require('****.php'). the session library called two times in same file.

– Varinder
Nov 10 '17 at 8:15















You can set in the autoload.php $autoload['libraries'] = array('database', 'session');

– Anand Pandey
Nov 10 '17 at 8:19





You can set in the autoload.php $autoload['libraries'] = array('database', 'session');

– Anand Pandey
Nov 10 '17 at 8:19













Where is this error show? Means in controller or model?

– Anand Pandey
Nov 10 '17 at 8:22





Where is this error show? Means in controller or model?

– Anand Pandey
Nov 10 '17 at 8:22













@AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.

– Varinder
Nov 10 '17 at 8:27





@AnandPandey error showing in controller. I am trying to use another controller's method in main controller. That's why I added controller1.php file in controller2.php.

– Varinder
Nov 10 '17 at 8:27












2 Answers
2






active

oldest

votes


















0














Add changes in application/config/autoload.php file



$autoload['libraries'] = array('database', 'session');


and in config



$config['encryption_key'] = 'pqrstuxyz';





share|improve this answer
























  • add your controller code so we can have a look.

    – Faridul Khan
    Nov 11 '17 at 7:29



















0














If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller



Simply Change your extended Class as following



Class YourController extends CI_Controller


to



Class YourController extends MX_Controller





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47217769%2funable-to-locate-the-specified-class-session-php-in-codeigniter-3%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Add changes in application/config/autoload.php file



    $autoload['libraries'] = array('database', 'session');


    and in config



    $config['encryption_key'] = 'pqrstuxyz';





    share|improve this answer
























    • add your controller code so we can have a look.

      – Faridul Khan
      Nov 11 '17 at 7:29
















    0














    Add changes in application/config/autoload.php file



    $autoload['libraries'] = array('database', 'session');


    and in config



    $config['encryption_key'] = 'pqrstuxyz';





    share|improve this answer
























    • add your controller code so we can have a look.

      – Faridul Khan
      Nov 11 '17 at 7:29














    0












    0








    0







    Add changes in application/config/autoload.php file



    $autoload['libraries'] = array('database', 'session');


    and in config



    $config['encryption_key'] = 'pqrstuxyz';





    share|improve this answer













    Add changes in application/config/autoload.php file



    $autoload['libraries'] = array('database', 'session');


    and in config



    $config['encryption_key'] = 'pqrstuxyz';






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 11 '17 at 7:28









    Faridul KhanFaridul Khan

    194116




    194116













    • add your controller code so we can have a look.

      – Faridul Khan
      Nov 11 '17 at 7:29



















    • add your controller code so we can have a look.

      – Faridul Khan
      Nov 11 '17 at 7:29

















    add your controller code so we can have a look.

    – Faridul Khan
    Nov 11 '17 at 7:29





    add your controller code so we can have a look.

    – Faridul Khan
    Nov 11 '17 at 7:29













    0














    If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller



    Simply Change your extended Class as following



    Class YourController extends CI_Controller


    to



    Class YourController extends MX_Controller





    share|improve this answer




























      0














      If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller



      Simply Change your extended Class as following



      Class YourController extends CI_Controller


      to



      Class YourController extends MX_Controller





      share|improve this answer


























        0












        0








        0







        If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller



        Simply Change your extended Class as following



        Class YourController extends CI_Controller


        to



        Class YourController extends MX_Controller





        share|improve this answer













        If you use Codeigniter Modular Extensions HMVC this error can occur if you forget to change your class to extend MX_Controller instead of CI_Controller



        Simply Change your extended Class as following



        Class YourController extends CI_Controller


        to



        Class YourController extends MX_Controller






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 14 '18 at 11:22









        Matee GojraMatee Gojra

        497412




        497412






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47217769%2funable-to-locate-the-specified-class-session-php-in-codeigniter-3%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Xamarin.iOS Cant Deploy on Iphone

            Glorious Revolution

            Dulmage-Mendelsohn matrix decomposition in Python