Question

My php is ran on apache webserver on port 80. My jsp is ran on apache tomcat on port 8080.

I am trying to get the session variable i set at the php page in my jsp page.

Will this work?

Was it helpful?

Solution

That will not work. Both are completely different. A PHP session cannot be recognized by JSP Script or vice-versa.

Below are some indirect ways to achieve the scenario..

Way 1:

An ugly hack would be , write the session variable from PHP page to a file, such that a JSP variable can open the file and read it.

Way 2:

Set the session variable through PHP and pass it through the JSP script as a parameter via querystring.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top