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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:28:48+00:00 2026-06-09T15:28:48+00:00

I have a PHP project which has its multiple subdomains(a.domainone.com, b.domainone.com, c.domainone.com) hosted on

  • 0

I have a PHP project which has its multiple subdomains(a.domainone.com, b.domainone.com, c.domainone.com) hosted on another server and another main domain domaintwo.com on another server.

Aim: User can access subdomains of first domain only if user has logged in domaintwo.com domain.

Movement of user: A user visits on a.domainone.com > user is asked to clicked enter now > enter now has a ajax function to check user is logged into domaintwo.com or not (responses as needlogin or logindone) > if not a popup of domaintwo opens, on success login it closes echoing: loggin succesfull go ahead and hit enter now

Problem: After loggin it when user hits enter > same popup opens > echos login already done (hav put validation to check if session exist already) > so when checked echoing session varible found its blank on a.subdomain.com but when go to directly on the php page of domaintwo.com login handler it echos the value of session varibale correctly.

So I checked, the ajax response is always ‘needlogin’ ….!!!

Just an idea would be appreciating.

Thanks & Regards

Edit

I have already done
< ? php header(‘Access-Control-Allow-Origin: *’); ? >
in domaintwo.com otherwise i would not be receiving even the response of if session as ‘needLogin’ in ajax call.

  • 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-09T15:28:49+00:00Added an answer on June 9, 2026 at 3:28 pm

    You’d need the session_id from the session cookie on the browser. Fortunately (unforturately for you) a client browser will not allow access to cookies from a different domain. Since you can’t get the session cookie, you can’t get the session id, so there is no way to grab session across domains.

    If both sites are on the same server, and you have direct access to the session store, and you’re not regenerating session id’s, you might do something shady like reading the session_id on one site and pass it in the get parameters to the next site, then manually open the session file based on the id and read it…

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

Sidebar

Related Questions

We have an existing PHP page (from an earlier project) which could be described
I have a project which uses php's mt_rand() to generate different random integers but
For a homework project, I'm creating a PHP driven website which main function is
I have recently being trying to create a project which has several levels of
I have a PHP project setup in Netbeans (v6.8) where all the PHP files
All, We have a PHP project in SVN. We develop code and do SVN
In my PHP project I have two different models that have a function with
I have a large-ish PHP project (hundreds of files) that I've been brought in
I have this problem getting my newly created php project on Netbeans work on
I have 2 applications. App1 is some old selfmade php project, not using Zend.

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.