我正在使用PHP API后端构建一个react web应用程序。 但是SESSION没有得到维护

I have written a react app with a PHP backend. I have a login area and have got this working great. This then redirects the user to another part of my app. So far so good.

But I was relying on the app maintaining session to check the user has permission to certain apis etc.

so this is how I am setting the session when user logs in

if( $passwordconfirm ){
   $_SESSION["sitekey"]["adminuser"]["id"] = $u->id // loaded user id
} 

Then when checking to load another resource

if( isset( $_SESSION["sitekey"]["adminuser"]["id"] ) ){ // never passes this
  return array( "data" => $pages );
}  

It seems every fetch request I make creates a new session, I can confirm this as output session ids and every single one was different. Any reason for this or way I can get around this?