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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:19:06+00:00 2026-06-02T16:19:06+00:00

I use jQuery to update and load search results and the page navigation at

  • 0

I use jQuery to update and load search results and the page navigation at the bottom of the page. I have a jQuery slider and several HTML-Forms with checkboxes, for each of those elements I set a cookie (on change), and use .load() to load the content from load_search.php, which works very well in all browsers.

Now I use the same method to upload the page navigation, and I get very weird results. In the search.php, the jQuery code is:

// PAGE NAVIGATION //

$('#page_navigation').on("click", ".page_no_item" , function(event) {
      var id = (event.target.id);
      $.cookie("cur_page_no", id);
      search_results_load();
      page_navigation_load();
      alert($.cookie("cur_page_no")); // -> returns the right cookie value
    });

also, I check the value on document ready, to be sure:

$(document).ready(function() {  
      alert($.cookie("cur_page_no")); // -> also returns the right cookie value
    });

In the .php file that I load, in no-webkit browsers, $_COOKIE['cur_page_no'] returns the right value, just in webkit browsers, it always returns 1 (which I put as Standard, if the Cookie is empty or not set). var_dump() returns always string(1) "1" in webkit browsers.

Note: I have tried to run it not on localhost, but the problem remains. Please also note, that I use the exactly same way to read the other cookies (e.g. for the checkboxes which are checked) and they return the right value.

Any ideas or hints are highly appreciated! Thank you very much in advance!! 🙂

  • 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-02T16:19:09+00:00Added an answer on June 2, 2026 at 4:19 pm

    When i was facing this problem, it appeared that in several instances, there was actually two cookies by the same name. One of them was the php created cookie, the other was the javascript created cookie. In other instances, there was one cookie, but php would not properly output the updated value until a full page reload had occurred.

    It was problematic that the loading of a fresh page which caused the cookie’s desired “new” value to be read. So one way to deal with php’s late cookie update effect is to both use the cookie methods available to it and also just setting $_COOKIE['yourCookieName'] = $val as well.

    The solution I had to stick with, unfortunately, is to handle a particular cookie either completely with JS or PHP and stick with it, and that was the only way i could get it to never have and read / value update / duplication problems

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

Sidebar

Related Questions

I have an existing HTML form that I'm trying to update to use jQuery.load().
tl;dr summary : jQuery's load() method called like: $('#foo').load('similar.html #foo') results in DOM structure
I would like to use jquery to update my attribute value, because I want
I use jquery picnet table filter - http://www.picnet.com.au/picnet-table-filter.html I need to display count of
I use jquery flot for my pie charts and I have a problem with
I have just updated my site to use a jQuery plugin jquery.raty.min.js The plugin
I am using jQuery with .load function to update count, however if the button
I'm trying to use jQuery to load a PartialView. It does this fine at
I am building an invoice system, where I will use jQuery, to update fields.
I use the jQuery Tools Overlay plugin and I have this code here <script

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.