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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:27:33+00:00 2026-06-14T02:27:33+00:00

I am developping a client side web application with jquery I want to store

  • 0

I am developping a client side web application with jquery

I want to store all visited pages, I use cookie for it

So, I have two element to store:

  • page URL
  • page title

I start creation of data in cookie as :

Index.html :

if(!$.cookie("history")){
        var url_history = document.location;
        var title_history = $("html title").text();
        $.cookie("historyURL", url_history);
        $.cookie("historyTITLE", title_history);
    }

anotherPage.html :

var url_history = document.location;
var title_history = $("html title").text();
$.cookie("historyURL", url_history);
$.cookie("historyTITLE", title_history);

Problem is that cookie’s new value overwrites the old.

I think I should set an object, not string such as:

var objHistory = [];
objHistory.push({url:document.location, title: $("html title").text()})
$.cookie("history", objHistory);

Now I have another problem:

I can’t retrieve My Object from cookie

When I am trying to get my Object from cookie, It shows a string “object” not Object

Is it possible to set an object in cookie?

thank for your help

  • 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-14T02:27:34+00:00Added an answer on June 14, 2026 at 2:27 am

    A cookie (having a limited 4K size) is the last place I would attempt to store an array of pages visited. A cookie would be the last storage method I’d attempt to use due to its limitations. If you are in HTML5, why are you not using the localStorage for this purpose?

    Tutorial: http://www.w3schools.com/html/html5_webstorage.asp

    The localStorage handles only STRING key/value pairs. A workaround can be to stringify your object before storing it, and later parse it when you retrieve it:

    var testObject = { 'URL': 1, 'TITLE': 2 };
    localStorage.setItem('testObject', JSON.stringify(testObject));
    var retrievedObject = localStorage.getItem('testObject');
    console.log('retrievedObject: ', JSON.parse(retrievedObject));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a web application using jQuery Mobile on the client side and PHP
I'm developing a Web App that uses JavaScript + JQuery on the client side
I am developing asp.net with c#web application. I want to have a control in
I am developing an client server communication application in C. I want to encrypt
I'm developing a client-server application and have been tasked with adding support for running
I am developing a client-server application using .Net Remoting. From my server I want
I am developing an web application which can upload/download a file from client to
I am developing a web application and have decided to go with knockout.js to
I'm developing a web application using .net/c#. I have a user control that I
I'm developing a web application that deals with travel. I want to be able

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.