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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:50:22+00:00 2026-05-28T02:50:22+00:00

How do you store a multi-array type of data into a cookie. For example:

  • 0

How do you store a multi-array type of data into a cookie.

For example: [[1, 'foo'], [2, 'bar'], [3, 'foobar']]

I can get it to work with a single dimensional array as such:

cookies[:foobar] = { :value => cookies[:foobar] << ",1" }

and then do

cookies[:foobar].split(',').include?("1")

To verify that 1 exists inside the cookie. Not too sure how I can get around this with a multidimensional array

  • 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-28T02:50:23+00:00Added an answer on May 28, 2026 at 2:50 am

    Serialize array into json and store to cookies.

    Look at two methods:

    ActiveSupport::JSON.encode(object)
    ActiveSupport::JSON.decode(string)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to store a multi-dimensional associative array of data in a flat file
I have a multi dimensional array, like this: array('name' => array('title'=>'Title','date'=>'Created')) I store it
hi i want to know why i cant store multi dimensional(array size is more
I have an app that shows store sales. It is a multi-dimensional array, so
It is possible to put an array into a multi dim array? I have
I am looking for a free/open source database which can properly store (multi-dimensional) arrays.
Are multi-threaded CLR stored procs possible? I have a data-intensive task with lots of
I store some time values in sqlite in %H:%M string format (for example 15:43),
I store serialized data in the registry. I want to use a foreach loop
I have a multi-byte primitive type called s32 which I want to read from

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.