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

  • Home
  • SEARCH
  • 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 1054519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:25:12+00:00 2026-05-16T17:25:12+00:00

Hi all , i’m testing out a service for internal ads on our website…

  • 0

Hi all,
i’m testing out a service for internal ads on our website…
I need to save internal session (PHP) to know what ads have been displayed and some other protection stuff…

The problem is that if i access to the API throught webbrowser GET or POST it does session (and saves the cookie of php session), but if i use jQuery.ajax() method it doesn’t save it…

My link for tests is http://search.microdual.com
(this is because i wanted a customized google search on my laptop :p)

I suggest you to use firebug to take a look at the javascript code. (PHP code isn’t needed because it is working on clicks…)
To simplify the debugging, i print out on response json array from server the session id on the var {id_sessao:"..."}…

Thanks in advance,
José Moreira

EDIT:

Headers from server:

Date    Wed, 08 Sep 2010 11:24:48 GMT
Server  Apache/2.2.8 (Ubuntu)
P3P CP="NOI NID ADMa OUR IND UNI COM NAV"
Cache-Control   private, must-revalidate
Access-Control-Allow-Orig...    *
Access-Control-Allow-Cred...    true
Access-Control-Allow-Meth...    OPTIONS, GET, POST
Access-Control-Allow-Head...    Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control
Set-Cookie  SN4b55935921bde=7ad280272050b4b44f17769909fd6f34; path=/ SN4b55935921bde=7ad280272050b4b44f17769909fd6f34; path=/
Keep-Alive  timeout=15, max=97
Connection  Keep-Alive
Transfer-Encoding   chunked
Content-Type    text/html; charset=UTF-8

Headers from the jQuery Ajax request:

Host    www.microdual.com
User-Agent  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; pt-PT; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept  application/json, text/javascript
Accept-Language pt-pt,pt;q=0.8,en;q=0.5,en-us;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive  115
Connection  keep-alive
Content-Type    application/x-www-form-urlencoded; charset=UTF-8
Referer http://search.microdual.com/
Content-Length  29
Origin  http://search.microdual.com
Pragma  no-cache
Cache-Control   no-cache

Where is the cookie control on the jQuery Ajax Request?

  • 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-16T17:25:13+00:00Added an answer on May 16, 2026 at 5:25 pm

    The problem is probably that your parent document is on search.microdual.com, and you are requesting a script from www.microdual.com. The session cookie isn’t transported across domains.

    If you are not using document.domain – I don’t see it anywhere? – you will also have the additional problem that the AJAX call fails due to the Single Origin Policy.

    To fix the cookie issue, you could either

    • set the cookie’s domain to .microdual.com so it works in both sub-domains

    • carry the session across manually in the URL (?sessionid=xxxxx) and continue the session using session_id("xxxxx");.

    • put both scripts on the same sub-domain (search.microdual.com)

    The latter would be the easiest way.

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

Sidebar

Related Questions

All front-end developers know the pain of coding for Firefox, then viewing our then
All the recent VisualSVN Server posts made me want to check it out. I
All I know about the constraint is it's name ( SYS_C003415 ), but I
All the articles I've found via google are either obsolete or contradict one another.
All I want is to be able to change the color of a bullet
All throughout an application wherever error messages (or other user messages) are used I
All I want is to update an ListViewItem's text whithout seeing any flickering. This
All too often I want a WPF slider that behaves like the System.Windows.Forms.TrackBar of
All of my users are a short walk down the hall, and all of
All, I currently have two projects that are under SourceSafe that I am unable

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.