apache httpclient and spawning a browser that will share the session
I'm have a java program that uses Apache httpclient api. This is used to login to and communicate to a webapp. Once logged in, there's a situation in which the program issues an execute process to open up firefox to hit the webapp and allow the user to see data in the browser. Since the java program is already logged in, is there a way to share that curr开发者_运维技巧ent session PHPSESSID so that the spawned firefox is already logged in and working in that same session?
You could write your own session handling callback functions that will store session data in a database. Then all you need to do is pass the PHPSESSID along with the URL that you're opening in Firefox and you can continue the session from there. Read more here:
http://www.php.net/manual/en/function.session-set-save-handler.php
There are some good examples of a databased session in the user comments
精彩评论