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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:35:18+00:00 2026-06-14T13:35:18+00:00

I set a cookie on Rails like this, cookies[:account] = { :value => @account.to_s,

  • 0

I set a cookie on Rails like this,

cookies[:account] = { :value => @account.to_s, :expires => 3.month.from_now }

Which seems to be working fine, a simple debug @account shows

--- myvalue
…

But when calling the cookie using jQuery.Cookie It return a "[object Object]" instead.

> $.cookie('account');
"[object Object]"

Any idea why is this happening and how to solve it?

  • 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-14T13:35:19+00:00Added an answer on June 14, 2026 at 1:35 pm

    [object Object] is the return value from Object.toString(), so that means that $.cookie(‘account’) is returning a non-Number, non-String object.

    On way to start figuring out what’s in the return value (in an effort to help you determine what’s in the object returned) is to loop over the properties to figure it out.

    So, like this:

    var obj = $.cookie('account');
    var msg = [];
    for(var i in obj)  msg.push( i +" = " + obj[i]);
    alert(msg.join("\n")); // or console.log(msg.join("\n"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a Rails controller, I can set a cookie like this: cookies[:foo] = bar
I need to set a cookie with javascript which I'm doing this with the
How can i read cookie set date? In rails api I can not find
I got this cookie returned from web-server in Set-Cookie header: PHPSESSID=462rutd8g0sbg9sinh3hqa2ol6; path=/,wordpress_test_cookie=WP+Cookie+check; path=/,wordpress_ca07030412dd7fcd4dbeaae0bd9f5df9=testemail@example.com; expires=Sun,
I would like authogic to never set a user_credentials cookie, and only use the
In Ruby on Rails, how do I set the session cookie's httpOnly setting to
The rails session cookie is HttpOnly by default but the remember_user_token cookie set by
How do you delete a cookie in rails that was set with a wild
How do I set a Rails cookie to start and/or expire at a certain
How do I set up a session value that expires 1.hours from now 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.