Il computer in rete non legge le sessioni e i cookie

Hi, connecting a secondary computer via LAN and opening the application via browser neither cookies nor sessions work, I can’t use the exe functions because the sessions must be different as well as the cookies, a login made in the main computer must be different from the secondary computer. So I would like to save cookies and sessions inside the PC that is using them.
How should I do it?

It doesn’t give me any errors, simply on the secondary computer it doesn’t save and doesn’t read the sessions.

Sure, session and cookies are saved by PHP locally, so since the EXE is running on one computer, they will be stored in the same location for all PCs calling the EXE as a server.

A possible solution is to generate a unique session ID for each computer accessing the application. This way, sessions will not conflict between the main and secondary computers. You can modify your PHP code to ensure that each client has a unique session by using:

session_id(uniqid());
session_start();

Or try this:

session_set_cookie_params([
    'lifetime' => 0, // Session cookies only last for the session
    'path' => '/', 
    'domain' => '', // Set to an empty string to make it machine-specific
    'secure' => false, 
    'httponly' => true
]);
session_start();

it’s fine to avoid conflicts very useful, the problem is that it doesn’t read the sessions at all. Maybe I have to put a relative path to save the session file? Is there a feature to set or do I have to change for example the session.save_path? In this case however I don’t know what path to insert.
Thanks.

To explain myself well on secondary computers if I do var_dump($_SESSION) the result is an empty array

You also have options for session defined in PHP.INI. Can you please check if some options could be useful to your problem?
Anyway, we’ll test ourselves the var_dump($_SESSION) code and see what could be the reason.

I did some tests both on the php.ini file and in the code via php by setting different paths for saving sessions, but if I understood the problem could be the absolute path that does not work starting from the web browser, maybe a relative path would be needed that works both from the EXE and the browser, but I did not find a way.
From bowser it does not read the saved sessions, if the reason is not the path maybe it could be some setting that I did not understand.
Thanks

I have the same big problem

Session cookie maybe never created or they will not be transferred.

The same thing with xampp as intranet server works well.

It must be a thing of the heserver.

Thanks for the additional report. We’ll explore this problem.
If we have a debug build available, would you be OK to test it?

2 Likes

Of course, yes

I’m also available

Here is a new build for you to test with your project:

https://files.gdgsoft.com/exeoutput/temp/EXORun2.7z

Unpack the archive to a local folder and move the EXORun.dat file to this folder:

C:\Program Files (x86)\GDG Software\ExeOutput for PHP 2024\CEFRuntime

Make a backup of the existing file in case of.

Then, start ExeOutput again and compile your project.

Thank you.

It’s look good.
But i am still testing.

We will deliver our program shortly. There will be over 150 installations with around 1000 users. There are still a few small problems that may also come from our PHP framework dbXapp. Sometimes in a $_GET there is a key with a ‘?’ at the beginning.

I also have the same problem, I solved it by inserting a GET key at the beginning that I don’t use

I’m testing it but everything seems to work.
I see a difference that it didn’t make before.
By scanning files inside a folder
$lista=glod($path)
foreach($lista as $value){
etc…
}
In the exe version the scan is very slow, while in the browser version it is fast.
Just for information I can solve it without problems, but maybe it could interest you.
Thanks

Thanks for the report. The issue is probably due that in the EXE version, the EXE must handle the UI too, whereas in the browser version, it doesn’t.

1 Like

Thanks for the follow-up!

Interesting, if you know how we can reproduce that with a simple PHP code, it would be helpful to debug that.

<a href=‘slider.php?nome_foto={$dati_foto[‘nome_foto’][$i]}&cartella=$cartella’>

RESULT ARRAY $_GET
$_GET[‘?nome_foto’]
$_GET[‘cartella’]

2 Likes

This will be fixed in the incoming 2024.1 update. Thanks again for the report!

1 Like

I still have the following problems.

1.) when I use php extensions dlls Outside the EXE the DLLs are not loaded. But the DLLs are in the ext folder.

2.) When I copy an exeoutput project, the paths from the file manager are absolute and refer to the paths and files from the copy project.

It would be better if the system worked with relative paths.

So I created new versions several times, but compiled unwanted source code from the previous version.

After some initial problems, I’m now starting to like exeoutput again.

1 Like

Some PHP extensions require additional DLLs (dependencies), generally available in the “PHPRuntimeXX” subfolder of ExeOutput. When you compile the DLL into the EXE file, ExeOutput includes the dependencies automatically. But not when you use external DLL files.

Yes, it’s a feature on our TODO list. We already implemented relative paths in HTML Executable, so they will come into ExeOutput too.

Thanks!