I have no experience connecting PHP and a Java application server, but with integration in general:
A common way to make one character is to read the session identifier (for example, a cookie set by the Java server) in a PHP script that passes it to the application server in the country (for example, through the command line, by creating an HTTP call or an instance of the shared cache) and receiving authentication status.
If this is not possible, for example. since services work in different domains, you must pass the session ID of the application server to the PHP application on the first call. The PHP application will then create its own session and store the session identifier from the application server in it. Internal application server session verification will work as described above.
If you need to exchange more than just the "logged in / not logged in" flag, you can also learn to replace PHP session processing with session_set_save_handler () . Your user session function, instead of storing the session data in a file, receives its data from your application server, which can pre-populate the session data with such things as authentication status, username, etc. It would also provide some freedom of communication between applications.
Of course, first make sure that the built-in Java / PHP integration features mentioned by cletus no longer do the trick.
source share