You can share sessions between web applications by using a Single Sign-On Valve.
You would set crossContext=true
if you wanted to share some information between different Web Applications in the same Virtual Host.
For example app1 would call:
setAttribute("name", object);
and another app could call
getContext("/app1").getAttribute("name");
to read the information. If crossContext wasn't set to true, the getContext("/app1") would have returned null.
However, the use of crossContext is both rare and potentially insecure.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…