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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:42:14+00:00 2026-06-12T04:42:14+00:00

I have a JavaScript application hosted at x.com which uses AJAX (through jQuery) to

  • 0

I have a JavaScript application hosted at x.com which uses AJAX (through jQuery) to contact an Apache server hosted on the LAN environment (with a static IP, 192.168.1.5).

The Apache server exposes an API which requires the user to have a specific cookie set to use it.

My problem is that I can’t get the Apache server to set a cookie with the correct domain (192.168.1.5), so that the browser sends the cookie with the AJAX call.

Is there any way to set a cookie with an IP as the domain? All examples I have seen require that the domain is of the form example.org.

The scenario is as follows:

  1. The JavaScript application at x.com sends an AJAX authentication request to 192.168.1.5.
  2. The response from 192.168.1.5 has a Set-Cookie header which should set the cookie to the 192.168.1.5 domain.
  3. The JavaScript application at x.com sends an AJAX request to the API at 192.168.1.5 with the cookie from step 2 as a part of the 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-06-12T04:42:15+00:00Added an answer on June 12, 2026 at 4:42 am

    Both server and client need to explicitly tell the other that they want cookies.

    JavaScript

    xhrInstance.withCredentials = true;
    

    Server Header

    Access-Control-Allow-Credentials: true
    

    https://developer.mozilla.org/en-US/docs/HTTP_access_control#Requests_with_credentials

    To sum it up: it has nothing to do with the IP address. The host of the cookie can be an IP address or a domain name.

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

Sidebar

Related Questions

I have a Sproutcore application which uses CouchDB hosted by Cloudant. In devenv I'm
I have a Host Javascript Application, which not use AMD, BackboneJS or RequireJS but
I have web application of which major part is javascript. I request images from
I have a web application written in ASP.NEt/C# and javascript. It uses session variables.
I have a scenario, in which a .net application is hosted from SAP portal.
I have a WinForms application in which I have hosted a web page inside
I am working on JavaScript application on the platform which does not have support
I have a JavaScript application that uses XMLHttpRequest to fetch and parse about 60,000
Assume you have a customer-facing application hosted on a Web server. You have no
I have JavaScript application, where I use client-side templates (underscore.js, Backbone.js). Data for initial

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.