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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:32:27+00:00 2026-05-29T05:32:27+00:00

I have a cookie and need to read it with JQuery or just javascript

  • 0

I have a cookie and need to read it with JQuery or just javascript if JQuery alone is not possible.

Then I need to pass the value of that Cookie to a PHP variable

Can this be done?

UPDATE: I need everything to happen in the same page.

  1. Javascript reads the already existing cookie.
  2. $somePHPvariable = MyJavascriptCookieValue;

I need to use Javascript to read this cookie because I am using a wordpress cookie created in function.php and php cannot read the cookie when it’s create but after the next reload of the page, which is no good to me.

  • 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-29T05:32:28+00:00Added an answer on May 29, 2026 at 5:32 am

    In PHP you can directly get the value of the cookie with $_COOKIE['variable_name']…

    If you really want to get the value of the cookie in JavaScript then here is one of a few different plugins to help read/write cookies with jQuery: https://github.com/carhartl/jquery-cookie

    You can then use AJAX to send the cookie information to your PHP script:

    $.ajax({
        url : 'path/to/server-side.php',
        data : { cookie : $.cookie('the_cookie_name') }
    });
    

    This will send the cookie as the GET variable cookie. You will be able to access it via PHP like this: $_GET['cookie'].

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

Sidebar

Related Questions

I need to write a PHP or javascript that can read the clickbank cookie
I have a function that checks if a cookie (by name) exists or not:
I have a cookie that is formatted like partA:partB . The colon is not
I have a PHP script which sets a cookie called user. I need to
I need my chrome extension to read a value of a cookie set by
I have an API that is available only in javascript (no PHP). It fetches
I have a need to create a HttpSession (via cookie) whenever a client invokes
I have a cookie set as yab_uploadmode and it has numeric value ranging from
We have a cookie management library that writes a cookie containing some sensitive information,
I have a Rails app that sets a cookie and does a redirect to

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.