1) Mixing PHP and JAVA is not easy.
2) -Dorg.apache.catalina.JSESSIONID=PHPSESSIONID so that servlets will use the same sessionid (you will have to store the session information and restore it.
3) See 2)
The phpservlet in JBossWEB is designed for a migration tool for PHP to JAVA but it may fit to your needs.
Thanks for your feedback!
In 2) do you mean I still have to manually implement session context handling from scratch, or that I have to use servlet session to store context-related objects in it?
I will check the phpservlet, was't aware about it, thanks!
Seems like phpservlet runs in context of a java as. This does not go along well with my constraint of leaving PHP on the website hosting, which does not allow use of any java. So there is need to somehow communicate user requests from PHP to the servlet.