开发者

apache httpclient and spawning a browser that will share the session

开发者 https://www.devze.com 2022-12-19 14:51 出处:网络
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 ope

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

0

精彩评论

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