Menu

[r319]: / trunk / php-java-bridge / examples / php+jsp / sessionSharing.php  Maximize  Restore  History

Download this file

19 lines (16 with data), 449 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<HTML>
<TITLE>PHP and JSP session sharing</title>
<BODY>
<?php
$session = java_session("sessionSharing");
if($session->get("counter")==null) {
$session->put("counter", new java("java.lang.Integer", 1));
}
$counter = $session->get("counter");
print "HttpSession variable \"counter\": $counter<br>\n";
$next = new java("java.lang.Integer", $counter+1);
$session->put("counter", $next);
?>
<a href="sessionSharing.jsp">JSP page</a>
</BODY>
</HTML>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.