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 8453751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:50:37+00:00 2026-06-10T11:50:37+00:00

here is my code to set session $login_data = array(‘logged_in’=>TRUE, ‘user_id’=>$userid); $this->session->set_userdata($login_data); redirect(‘dashboard’); above

  • 0

here is my code to set session

$login_data = array('logged_in'=>TRUE, 'user_id'=>$userid);
$this->session->set_userdata($login_data);
redirect('dashboard');

above code creates a new entry in ci_session table in my db and it has logged_in value

In dashboard controller i am checking session. Below is my code in dashboard controller

function __construct(){
        parent::__construct();
        $logged_in = $this->session->userdata('logged_in');
        if(!$logged_in){
            redirect("welcome");
        }
    }

In above constructor block i am not getting the value of logged_in.

I have also tried to print all my userdata using var_dump($this->session->all_userdata) but all I get is an empty string.

Please tell me what could be the reason behing it. I also searched for cookie but i didn’t find that in my computer. below is my config detail

$config['sess_cookie_name']     = 'ci_session';
$config['sess_expiration']      = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie']  = TRUE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']      = 'ci_sessions';
$config['sess_match_ip']        = TRUE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']  = 300;
  • 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-10T11:50:39+00:00Added an answer on June 10, 2026 at 11:50 am

    I have solved my problem. I just forgot to change my Cookie Related Variables in config. –

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

Sidebar

Related Questions

Here is the problem from code chef : A set of N dignitaries have
Here is my upsert code: UPDATE LastTicket SET LastTicketNumber=LastTicketNumber+1 OUTPUT INSERTED.LastTicketNumber WHERE CategoryId='1'; IF
here is some code I've been working on, basically I need to set up
i can't set title to Action bar sherlock. Here is my code: public void
I tried to set up my togglebutton properties layout using style.xml. Here's my code:
I have a card layout set in my app.js. here's the code; ... launch:
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here Scenario is HttpContext.Current.Session[value].ToString() gives null value, even have already set session value when
When user is inactive for 3 hour ,How to set session expire. Surly this
I'm having a problem where my session variables aren't getting set/saved. Here is my

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.