View Single Post
Old 06-29-2022, 07:33 AM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
A quick 'sessions' question

Can sessions be carried across multiple domains or are they specific to just one?

I'm using the following on one of our admin systems right now and wondered if it was a good idea to have the same session carried across to our others for staff members that have access to multiple systems?

Quote:
<?php
// Initialize session
session_start();

// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: index.php");
exit;
}
?>
If they are able to be used on multiple domains, will the code above be enough or do I need to change that to something else?

Are there any possible issues with using one session across several domains?

TIA for any information you can offer
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote