Is there a solution that allows me to create a session file based on the first request(request is not coming from a browser but contains a unique ID that will be maintained for a given period/session) and then read from this session file on subsequent requests coming from this same user (identified by the unique ID in request)?
I thought that when I set a session_id($id) or session_name($name) on the first request and create a session(ie session file), I will be able to on user's subsequent request identify and read this session file and pick values from it.
Note: These requests are not coming from a browser.
In a web browser, the cookie holds the ID that identifies the session files so values can be picked from it on subsequent requests. But I don't have this available.
EDITED TO ADD CODE LOGIC
if($_GET['sequence'] == 0) // first request
{
$uniqueID = $_GET['uniqueID'];
// I thought this will create a session file with value provided
session_id("ses$uniqueID");
session_start();
$_SESSION['data1'] = $_GET['data'];
}
else // subsequent request
{
// we should have a session file, so I thought this will fetch it
$uniqueID = $_GET['uniqueID'];
session_id("ses$uniqueID"); //;(
session_start();
$data = $_SESSION['data1'];
}
// ....`