Jump to content

Forcing sessions


camrydad

Recommended Posts

Hi Guys,

 

First post here....

 

So here is what I want to do.....

 

Another system is posting an XML to our server.

Inside the XML is an value like '1231231234'.

I want to set the session when I process this XML.

The next time I get an XML with the same value '1231231234'.

I want it to be considered the same session.

 

Is this possible?  I've been playing with the following code snippet and can't seem to quite get the session to stick.

 

Any hints would be much appreciated, thank you very much.

 

<?php

session_start();
session_id("1231231234");
session_name("1231231234");

if (isset($_SESSION['stuff'])) {
  echo 'stuff is already there<br/>';
} else {
  $_SESSION['stuff'] = "1231231234";
}  

echo 'session id is set to ' . session_id() . '<br/>';
echo 'session name is set to ' . session_name() . '<br/>';
echo 'session var stuff is set to ' . $_SESSION['stuff'] . '<br/>';

?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/187602-forcing-sessions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.