简体   繁体   English

对使用 mod_jk 的 Apache httpd 和 Tomcat 之间的 session 管理感到困惑

[英]Confused about session management between Apache httpd and Tomcat using mod_jk

I am confused about session management between Apache httpd and Tomcat using mod_jk.我对使用 mod_jk 的 Apache httpd 和 Tomcat 之间的 session 管理感到困惑。 I know that Apache is typically used for serving http pages, and Tomcat is used as instructions for handling different types of web requests.我知道 Apache 通常用于为 http 页面提供服务,而 Tomcat 用作处理不同类型的 Z25967A5EC337E9 请求的指令。 So when an application using both of these receives a request, does Apache create a session where within that session a Tomcat session is created? So when an application using both of these receives a request, does Apache create a session where within that session a Tomcat session is created? I am asking this because none of the changes I make to sessions in my apache httpd.conf file seem to take affect, but the changes I make to my Tomcat config files do affect my application.我之所以这样问,是因为我对 apache httpd.conf 文件中的会话所做的更改似乎都没有影响,但我对 Tomcat 配置文件所做的更改确实会影响我的应用程序。

Apache httpd is - especially when mod_jk is in the game - a reverse proxy for Tomcat. Apache httpd 是 - 特别是当 mod_jk 在游戏中时 - Tomcat 的反向代理。 It typically does little more than forwarding requests and responses.它通常只是转发请求和响应。

If a tomcat-based web application requires a session, Tomcat will create the session and handle it typically with a cookie. If a tomcat-based web application requires a session, Tomcat will create the session and handle it typically with a cookie. This session information is part of the proxied content, which Apache httpd neither creates, deletes or manipulates (unless you explicitly configured it to do so, in which case you'd knew that you did).此 session 信息是代理内容的一部分,Apache httpd 既不会创建、删除或操作这些信息(除非您明确将其配置为这样做,在这种情况下您会知道您这样做了)。

In case Apache httpd has some other components (eg PHP based) that require sessions, this part of session handling would be subject to the PHP application. In case Apache httpd has some other components (eg PHP based) that require sessions, this part of session handling would be subject to the PHP application.

Tomcat sessions behave the same, no matter if they're proxied or not. Tomcat 会话的行为相同,无论它们是否被代理。 So, Apache httpd has (unless you cause it to) no effect on Tomcat sessions.因此,Apache httpd 对 Tomcat 会话没有影响(除非你导致它)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM