apache httpclient 并生成一个共享会话的浏览器

发布于 2024-08-20 18:39:56 字数 177 浏览 4 评论 0原文

我有一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉月流沐 2024-08-27 18:39:56

您可以编写自己的会话处理回调函数,将会话数据存储在数据库中。然后您需要做的就是传递 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文