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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.