Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8211225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:21:27+00:00 2026-06-07T10:21:27+00:00

I need to check if the user is logged in or not in CodeIgniter.

  • 0

I need to check if the user is logged in or not in CodeIgniter.

The login is happening in Joomla site.

I tried the following to initialize joomla .

define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define('JPATH_BASE', dirname(__FILE__) );

require_once ("../includes/defines.php");
require_once ("../includes/framework.php");

$mainframe =& JFactory::getApplication("site");
$mainframe->initialise();

$session =& JFactory::getSession();
$user = $session->get( 'user' );

But I got this message:

No configuration file found and no installation code available.
Exiting…

Joomla is installed on root and codeigniter on root/advanced

I am calling the code in controller.

How can I solve this?

EDIT:

Now I am getting this error:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: BM

Filename: core/CodeIgniter.php

Line Number: 364

Edit

My Controller look like this

function is_logged()
    {

                define( '_JEXEC', 1 );
            define( 'JPATH_BASE', '../');
            define( 'DS', DIRECTORY_SEPARATOR );

        require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
        require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
        //require_once ("../libraries/joomla/user/authentication.php");
        $mainframe =& JFactory::getApplication("site");
        $mainframe->initialise();

        $session =& JFactory::getSession();
        $user = $session->get( 'user' );



    }

Directory Structure

--Public_html
  --Joomla Istallation files
  --Advanced [This is a folder ,i installed codeignitor on this folder]

So the path to joomla is site.com/ and path to Codeignitor is site.com/advanced

More about the Error

Line 364 on Codeignitor Core says that :

// Mark a benchmark end point
    $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end');

and i can see the following on the starting of CI core

    $BM =& load_class('Benchmark', 'core');
    $BM->mark('total_execution_time_start');
    $BM->mark('loading_time:_base_classes_start');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:21:29+00:00Added an answer on June 7, 2026 at 10:21 am

    I know its an old post but you need to make sure JPATH_BASE points to the directory where your configuration.php file is. I would use the absolute path rather than a relative path.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in the project I'm creating I need to check if the user is logged
How can I block access to the site if a user is not logged
Below is the code to check whether user is logged in or not ,
To check If a user is logged in I need to pull off a
I'm using Magento 1.5, and I need to check whether the currently-logged-in user is
I am not able to check if user is logged in or not in
I need to check that the user is still logged in so that I
I need to check user input from an EditText against the pattern described before
I have a web application inside where i need to check whether the user
My point is this. For test i need when user check chk1 the chk2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.