Send sessions to default browser

Having some issue with project and before I dig in deeper:

Can sessions from an exeout .exe file be passed to default browser?

Something like this on page in exe:

session_start();
// Set session variable
$_SESSION["math_key"] = $math_key;

and then read in browser like:

session_start();
$math_key = $_SESSION["math_key"];

Before spending hours debugging, want to make sure even feasible first.

I know there are ways like below (url), am I on right track or is this not possible?

$sessionValue = $_SESSION['math_key'];
$url = "https://example.com/next_page.php?session_value=" . urlencode($sessionValue);

Or are there any other ideas for something similar?

Nope, not going to work. WebRTC might work but does not seem like worth the effort.

No, that’s not possible, unfortunately.

Thanks for confirming. Was pretty sure not possible but had hopes someone else might had need to pass a session. One way I am experimenting with is via POST.

Sure, you can pass the session variables to a server using the internal viewer with POST and an AJAX request for instance.

Yes, but not always reliable :slight_smile: I deal with a “locked down” world and post with especially ajax raises flags like a new navy.

Just a thought - Put variables into json, encrypt to something url safe, then
exec (“start $url?data=$encrypted”);
maybe ?

Not a bad idea! Have to think about this and flow of code. You have any ideas on the actual code?

@oldteacher It would take me a while to work out fully, and pretty busy atm but these would most likely be the functions you would use.

Start with the array.

json_encode - https://www.php.net/manual/en/function.json-encode
openssl_encrypt - https://www.php.net/manual/en/function.openssl-encrypt.php
urlencode - https://www.php.net/manual/en/function.urlencode.php

Then at other end…

urldecode - https://www.php.net/manual/en/function.urldecode.php
openssl_decrypt - https://www.php.net/manual/en/function.openssl-decrypt.php
json_decode - https://www.php.net/manual/en/function.json-decode.php

Then you should be back at the original array.