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

  • Home
  • SEARCH
  • 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 6773879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:43:14+00:00 2026-05-26T15:43:14+00:00

I am saving some data in a session, and certain points in my websites,

  • 0

I am saving some data in a session, and certain points in my websites, I am giving the user the option to removes certain parts of the session based on the array key, the array I get when I do,

print_r($this->session->userdata('shortlist'); this leaves me the the following output,

Array ( [0] => Array ( 
    [id] => 40 
    [name] => Namey Name 
    [location] => location is a place 
    [talent] => voice over 
    [image] => ./media/uploads/headshots/width_60_249613_10150280293315435_717615434_9570480_8341358_n.jpg ) );

How can I remove this from my shortlist session? I have tried doing the following, but to no avail,

unset($this->session->userdata('shortlist')[0]);

  • 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-26T15:43:14+00:00Added an answer on May 26, 2026 at 3:43 pm

    You can use this:

    $this->session->unset_userdata('some_name');
    

    For more info:

    http://codeigniter.com/user_guide/libraries/sessions.html

    EDIT: After comment: You can do something like this-

    $shortlist = $this->session->userdata('shortlist');
    unset($shortlist[0]);
    $this->session->set_userdata('shortlist',$shortlist);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a action class for saving some data to a database.In action class
I have created a web service which is saving some data into to db.
I'm getting some data from the web service and saving it in the core
I'm saving some data using a series of NSDictionaries, stored in an NSMutableArray and
I'm having some trouble saving some data after using PHP's simplexml_load_file function. I want
If I were to select some rows based on certain criteria I can use
I have a Java web application which stores some data in the session. The
My image editing app is saving some important data in the documents directory. In
am having problem in Saving some data in my Java code. I have like
I am trying to get a popup after saving some data into the database.

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.