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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:36:54+00:00 2026-05-30T16:36:54+00:00

Whenever i try check for a value in my userdata column of my session

  • 0

Whenever i try check for a value in my userdata column of my session it thinks it’s blank, when it’s actually in the ci_sessions table serialised.

here’s the db content unserialised:

array (
  'user_data' => '',
  'edit' => 
  array (
    'image_id' => 'HF',
    'session_id' => '783c15b057bcd9c19d3fd82f367ee55d',
  ),
)

here’s how im checking for the userdata in my view (note sessions are autoloaded)

<?php if ($this->session->userdata('edit')) : ?> 

enter code here

and here’s how i set the session userdata:

            $values = array(
        'image_id' => implode(",",$uploaded_image_ids),
        'session_id' => $this->session->userdata('session_id')
        );

        $this->session->set_userdata('edit', $values);

Can anyone see the problem? (whole controller here http://pastebin.com/aXeRn1VN)
Also heres my config.php http://pastebin.com/A31nrC1b

  • 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-05-30T16:36:56+00:00Added an answer on May 30, 2026 at 4:36 pm

    View variables are separate from other variables in CI. I think (am still a bit of a CI newbie) that $this->session is not available in Views. This CI forum post discusses a couple of possible solutions to the problem http://codeigniter.com/forums/viewthread/100587/#508098 – one is to pass the value of ‘userdata’ from the session into the $data array you pass to the view – which seems the best solution.

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

Sidebar

Related Questions

Whenever I try installing anything using gem, I get this error - murtaza@murtaza-dev:~$ sudo
Whenever I try to edit existing or create new distribution provisioning profile on iOS
Whenever I try to use ranges in D, I fail miserably. What is the
Whenever I try to extend the Object prototype, I get an error: Error #1056:
Whenever I try to use apt-get/dpkg, it tries a to install a broken source.
Whenever i try to run sqlmetal, i get this: 'sqlmetal' is not recognized as
whenever I try to call my ejb from a client, I get this error
whenever I try to return the lat/long coordinates for my current location, my application
Whenever I try (My)SQL queries on the sever (the server is in debug mode
Whenever I try the following in my python interpreter. I am able to copy

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.