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.
As the
session_id()itself doen’t contain any data, there are a couple of things to consider: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')