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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:49:35+00:00 2026-06-12T22:49:35+00:00

Am using codeigniter to build an eCommerce site. I have a method on controller

  • 0

Am using codeigniter to build an eCommerce site.
I have a method on controller where users enter their delivery information before checkout, the method saves the delivery information and creates a new session variable called “orderid” which has the value of the orderid as its value. After setting the session variable the method redirects to the checkout controller where i retrieve the “orderid” from the session to retrieve the order from the db for the user to confirm the information before paying.

The problem is, when the user is redirected to the checkout page, they dont see their delivery data.
When do this

echo $this->session->userdata('orderid');

I can see the value
But when i pass it to my method that supposed to return an array of data

$order = $this->orders->get_order($this->session->userdata('orderid'));
print_r($order);

I get an empty array array()

When the checkout page is refreshed it behaves correctly.
What could be the problem

  • 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-12T22:49:36+00:00Added an answer on June 12, 2026 at 10:49 pm

    You cannot access session value like this

    $order = $this->orders->get_order($this->session->userdata('orderid'));
    

    You can use the following method it ll be work fine for you

    $orderid=$this->session->userdata('orderid');
    $order = $this->orders->get_order($orderid);
    

    **please remembere load session library at constructor or in this function

    $this->load->library('session');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using CodeIgniter (a PHP framework) to build an app, and I have an
I'm using CodeIgniter 2 (latest build) ...let's say I have this query: $CI->db->select(FileName, GUID,
Issue/Question : I'm using CodeIgniter to build an event calendar, and I have included
I've created a site using CodeIgniter and its build in session class. I've uploaded
I am using Codeigniter to build my project. Here i have some doubts or
I'm using CodeIgniter to build my first web app. For demo purposes, users can
I'm trying to build a multi-app site using CodeIgniter. The individual applications need to
Kind sirs, I'm using Codeigniter to build a blog. I might need a way
I'm using Codeigniter and the Active Record class to build a simple API in
I have built a local DVD Database using Codeigniter, With film names etc in.

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.