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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:25:45+00:00 2026-05-23T16:25:45+00:00

I am trying to read a cookie which I’ve set with javascript, jQuery Cookie

  • 0

I am trying to read a cookie which I’ve set with javascript, jQuery Cookie Plugin specifically, and then after that I’m reading it with PHP to write it into a database.

For some reason the cookie is being created on page load, but doesn’t “exist” until the page is refreshed. Which means that I’m pumping blank fields into my database tables.

The only way I can think of doing it is to AJAX out to a script which creates the cookie. Or ajax out to a script which returns the data to me in json.

The use case is that I’m creating a simple analytics class for an internal project, and I’d like to write into the database the users resolution, colour depth and all that jazz, which I’m using screen.width etc to get.

  • 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-23T16:25:45+00:00Added an answer on May 23, 2026 at 4:25 pm

    Cookie data are sent to the server (and forwarded to the PHP interpreter) when the client performs the request. Therefore, a cookie set by JavaScript on the client after the page has been requested from the server will not be transmitted until the next request to same server.

    What you have

    What you’ll have to do is to perform some kind of request (could be done via AJAX) where a PHP script handles the incoming cookie information and stores it in the DB.

    What you need

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

Sidebar

Related Questions

I want to be able to set a single cookie, and read that single
I am tring to read a cookie value which I got after login by
I'm trying to read a .doc file into a database so that I can
I'm working with ColdFusion trying to read the value stored in a session cookie
I am having problems of trying to set a session cookie(s) in Liferay 6.0
I was trying to read IE cookie file using C# I am stuck with
I'm trying to write cookie after logging in but it doesn't seem to save
Having an issue with ASP.NET, when trying to set a cookie on subdomain1.mydomain.com to
I have a cookie that is being set by Microsoft ISA. I want to
I'm trying to read a cookie, but don't have a clue how, basically. The

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.