Question: Is it possible to use something like sessions like the ones in PHP in C++?

In PHP they're used like

```
$_SESSION['name'] = $value;

```

I really want to make the same application using C++ as PHP...requires a run-time parser.

My application written in PHP uses sessions so that i can fetch some stuff from a website(numbers) and store the value in a SESSION varible which i call last to compare it to the new value when the page is reloaded.

I'd rather have the same functionality in C++.

Seeing as this is going nowhere i am going to provide the PHP code

```
<?php
session_start();

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,"http://dashjr.org/~luke-jr/programs/bitcoin/pool/balances.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);

echo 'Last BTC: '.$_SESSION['last'].'<br>';

$obj = json_decode($result,true);
echo 'Current BTC: ';
$new = (int)$obj["1Hy5h24yBYKtQ1vNGaxY5rBJSEuTiMkBkx"]["balance"]/100000000;
echo $new;

if((int)$_SESSION['last'] < $new)
{
    echo '<br><br>You earned more';
}
else
{
    echo '<br><br>You earned less';
}

$_SESSION['last'] = $obj["1Hy5h24yBYKtQ1vNGaxY5rBJSEuTiMkBkx"]["balance"]/100000000;

unset($result,$obj);

?>

```

I need to port *that* to C++.

Answer: 
This makes no sense, PHP sessions are a kludge because the process does not survive one HTTP request to the next. I really dunno what do you want to achieve here. Maybe <http://www.boost.org/doc/libs/1_46_1/doc/html/interprocess.html> this?
> 
> PHP...requires a run-time parser.
> 
> 
> 

Nope, install apc or any other compiled code cache, and php is only parsed once. Of course the generated bytecode is still interpreted...

On big frameworks (lots of code) parsing time can be a lot longer than actual script execution, so this cuts down the page times quite a lot.