java - Could not access php session variable once the tomcat restarts -
I am developing an application in Java that needs to integrate some PHP files under the Tomcat server. I have succeeded everything, but the problem is that when I show some error with the shutdown tomatat server
exception in the thread "JavaBridgeSessionTimer" java.lang.NullPointerException php.java.bridge. SessionFactory $ Later if I start again, then I can not use any session variable. From php files I tried a simple php program that ran within Tomcat. This problem will be solved after restarting the machine, but I do not want to do this often for any changes in any configuration files in the tinker. session1.php
& lt ;? Php session_start (); ? & Gt; K & lt; Body & gt; & Lt; Html & gt; & Lt; Form action = "session2.php" method = "post" & gt; & Lt ;? Php $ _SESSION ['name'] = "Mernam"; ? & Gt; & Lt; Input type = "submit" value = "submit" & gt; & Lt; / Form & gt; & Lt; / Body & gt;
session2.php
& lt ;? Php session_start (); ? & Gt; & Lt; Html & gt; & Lt; Body & gt; & Lt ;? Php echo ($ _SESSION ['name']); ? & Gt; & Lt; / Body & gt; & Lt; / Html & gt;
PHP session variables are organized in memory This means that if you turn off the server If they do, they are lost.
If you need to continue without regard to the server's restart, you will need to store them in the database or the same.
Comments
Post a Comment