开发者

Java and PHP sessions

I'm creating a Java applet which communicate with my PHP website by requesting pages and retrieving their contents. It works pretty well, and it allows my applet to use PHP sessions.

However, I tried to launch the applet with Opera (instead of Firefox), and it appears that Opera doesn't let my applet use its PHP session, and as Java (or at least IcedTea) doesn't handle PHP sessions itself, I can't make my applet work.

Is there any way to make Java be able to handle PHP开发者_如何学运维 sessions?


You would have to carry the PHP session ID in every query. That is, make a start_session.php which returns only the result of session_start(); and echo session_id() and use that number in the subsequent queries, that is, other.php?sid=XXXXX inside other.php use session_id($_GET['sid']); to start the session.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜