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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:40:46+00:00 2026-05-27T12:40:46+00:00

I have a question. Let’s say I am on website domain1.com and I click

  • 0

I have a question. Let’s say I am on website domain1.com and I click on a link on domain1.com that brings me to domain2.com. But I want to use the same session_id() that was set with session_start() in domain1.com on domain2.com. How do I accomplish this in PHP?

Thank you.

  • 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-27T12:40:47+00:00Added an answer on May 27, 2026 at 12:40 pm

    As the session_id() itself doen’t contain any data, there are a couple of things to consider:

    • If the session is set in a cookie, you can’t transfer it (unless to a subdomain), make sure you transfer it via GET
    • In order to have the data associated with the SESSION sync accross the servers, you have to share the file system (e.g. via GlusterFS), at least for the path the SESSIONS are saved (e.g. /tmp/php)
    • if you save objects in the SESSION make sure they are available on both servers

    If both domains are pointing to the same document root on the same server you only need to take care about the first point

    If you only want to use the session_id() and not the associated data, you can just set the id: session_id('yourSessionIdFromDomain1')

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

Sidebar

Related Questions

Maybe a basic question but let us say I have a string that is
I have a question, but let me first say that this is being performed
hi i have question i know that this question is somehow nonsense but let
Here's a question: let's say we have a png image 200x200 that is transparent
A dumb question: Let's say I have an object that i store in viewstate.
I would have question regarding web services. Let's say I have webservice client that
I have a question concerning unit testing. Let's say that I have several classes
Beginner rails/javascript question: Let's say that I have a simple Circle model in a
Let's say that we have a DIV x on the page and we want
General question: Let's say you have a list of vertices that you pass into

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.