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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:05:16+00:00 2026-05-15T11:05:16+00:00

Is it possible to share a session between my PHP app on a subdomain

  • 0

Is it possible to share a session between my PHP app on a subdomain and my Ruby apps on my other subdomains?

I don’t really know where to take it from here. I know I can manually set the domain to the root one so that the cookie is valid for all the subdomains, but how would I get/set stuff from/to the session so that it’s shared across the subdomains?

I mainly want to use this to share login for my whole subdomains.

For the sake of knowledge, if it is the wrong approach to the problem, albeit a doable one, I’d like to understand both how to do it, and why should I not.

Thank you all!

  • 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-15T11:05:17+00:00Added an answer on May 15, 2026 at 11:05 am

    If you want to share sessions in that manner (accross PHP/Java/Ruby/etc), you need to save sessions (and access them) from a Database.

    See: http://php.net/manual/en/function.session-set-save-handler.php

    And you would need an identical approach in Ruby.

    To share cookies across domains, you also need to change the PHP session configuration option for session.cookie_domain from the default of "" (which inserts your domain name) to: ".yourhost.com" (note the prefixed period).

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

Sidebar

Ask A Question

Stats

  • Questions 489k
  • Answers 489k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I wrote this little program to check it out: class… May 16, 2026 at 9:07 am
  • Editorial Team
    Editorial Team added an answer Well the notes here helped me get this running. So… May 16, 2026 at 9:07 am
  • Editorial Team
    Editorial Team added an answer A co-worker and I did some rudimentary benchmarks recently to… May 16, 2026 at 9:07 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

We may replace a PHP app with a Java EE app, but the problem
I would like to know if it is possible to read $_SESSION attributes without
I don't know if I've understanding MVC correctly if my question makes no sense,
im using a connection to a server in my php script, opened with fsockopen()
Rails comes with a handy session hash into which we can cram stuff to
I'm working on a website that uses a non-secured asp.net session cookie. The session
As part of my attempt to create an ASP.net that has the same look
I'm sure we've all worked on, or are aware of web applications (especially in
DNS Round Robin (DRR) permits to do cheap load balancing (distribution is a better

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.