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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:55:52+00:00 2026-06-15T14:55:52+00:00

i Have setup 2 domains/sites in the ISPConfig on amazon Web server EC2 instance,

  • 0

i Have setup 2 domains/sites in the ISPConfig on amazon Web server EC2 instance,

i have a domain named app.example.com and the other is https://www.example.com
Both domains setup in ISpConfig3. so both have separate webroot and code files.
I have setup some session variables on app.example.com , while on https://www.example.com i have only static contents. But in some cases i need to access the session variables from app.example.com to my top domain https://www.example.com

I have tried setting on http://app.example.com

ini_set('session.cookie_domain', '.example.com' );

session_start();

$_SESSION['user_name']= "my_session";

and then accessing $_SESSION['user_name'] on https://www.example.com

print_r($_SESSION['user_name']);

But nothing seems to be working, How can i make this to be working?.

  • 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-15T14:55:53+00:00Added an answer on June 15, 2026 at 2:55 pm

    The first comment of @Alan Gularte replies quite well I think. If it does not work, you may consider writing a cookie yourself to pass info back and forth.

    setcookie ("PassMySessionName", $_SESSION['user_name'], time() - 3600, "/", "example.com");
    

    Setting cookie domain to “example.com” will make it available both on www. and app.

    On the other side you will find it in the $_COOKIE array.

    $PassedUserName=$_COOKIE["PassMySessionName"];
    

    If you need it all to work without cookies enabled, it gets much more complicated, as $_SESSION will work appending parameters to your urls transparently. In that case (if you link from one site to the other) you may add them manually to the urls.

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

Sidebar

Related Questions

Say I have a www.foo.com domain which is setup to load my app on
I have setup Custom Domain https://developers.google.com/appengine/docs/domain I have uploaded An SSL certificate and private
My host : 1and1.com My setup : I have my main domain and a
I have a simple setup with my python libraries in /domains/somedomain.com/libs/ and all my
The Issue We have two sites, one domain, we want to setup a virtual
For example: We're running a two community sites on two domains (call them example.com
i have two domains setup one called fastcms.com and the other is called fastautos.com
I have my website setup to point to a directory on the web server.
We have a domain and now we need to setup an online store. Which
I have setup airbrake in my app but it doesn't seem to log any

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.