apache httpclient 并生成一个共享会话的浏览器
我有一个使用 Apache httpclient api 的 java 程序。这用于登录网络应用程序并与之通信。登录后,程序会发出一个执行进程来打开 Firefox 来访问 Web 应用程序并允许用户在浏览器中查看数据。由于java程序已经登录,有没有办法共享当前会话PHPSESSID,以便生成的firefox已经登录并在同一会话中工作?
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 current session PHPSESSID so that the spawned firefox is already logged in and working in that same session?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以编写自己的会话处理回调函数,将会话数据存储在数据库中。然后您需要做的就是传递 PHPSESSID 以及您在 Firefox 中打开的 URL,然后您就可以从那里继续会话。在这里阅读更多内容:
http://www.php。 net/manual/en/function.session-set-save-handler.php
用户评论中有一些数据库会话的好例子
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