简体   繁体   English

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

[英]apache httpclient and spawning a browser that will share the session

I'm have a java program that uses Apache httpclient api. 我有一个使用Apache httpclient api的java程序。 This is used to login to and communicate to a webapp. 这用于登录Web应用程序并与之通信。 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. 登录后,程序会执行一个执行过程以打开firefox来攻击Web应用程序,并允许用户在浏览器中查看数据。 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? 由于Java程序已经登录,是否可以共享当前会话PHPSESSID,以便生成的Firefox已登录并在同一会话中工作?

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. 然后,您需要做的就是传递PHPSESSID以及在Firefox中打开的URL,然后可以从那里继续会话。 Read more here: 在这里阅读更多:

http://www.php.net/manual/en/function.session-set-save-handler.php http://www.php.net/manual/zh/function.session-set-save-handler.php

There are some good examples of a databased session in the user comments 用户评论中有一些数据库会话的良好示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 apache httpclient并生成一个将使用java共享会话的浏览器 - apache httpclient and spawning a browser that will share the session using java Apache HttpClient会话无法正常工作 - Apache HttpClient Session not working 如何在 Apache HttpClient 4.1 中处理 Session - How to Handle the Session in Apache HttpClient 4.1 Apache HttpClient、基本身份验证和会话 cookie - Apache HttpClient, basic auth and session cookie 在不同服务器上从Apache到Tomcat共享会话 - Share session from apache to tomcat on different servers 从Java(Apache HttpClient)管理与ASP.NET站点的会话 - Managing a session with ASP.NET site from Java (Apache HttpClient) 如何在Apache httpclient中获取客户端的会话ID - how to get session id on client side in apache httpclient 在Apache Tomcat中的两个域之间共享会话cookie的解决方法 - Workaround to share session cookie between two domains in Apache Tomcat 在使用Apache HttpClient进行HTTP GET / POST时,是否可以将参数设置为Http Session? - Is there a way to set parameters to Http Session on making HTTP GET/POST using Apache HttpClient? apache commons httpclient 4.23表单登录问题在不同请求中使用了不同的会话cookie - apache commons httpclient 4.23 form login problems different session cookies used in different requests
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM