Fixed: Correct behaviour of Autologin cookies
Michael spotted that I used "default-server" in r1845558:
Quoting him:
It only works for webapps using "default-server". This name is configurable
in the ofbiz-component.xml and and should not be hard-coded in the code.
This fixes it
Thanks: Michael Brohl
@@ -922,7 +922,8 @@ public class LoginWorker {
Delegator delegator = (Delegator) request.getAttribute("delegator");
HttpSession session = request.getSession();
GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
- WebappInfo webappInfo = ComponentConfig.getWebappInfo("default-server", UtilHttp.getApplicationName(request));
+ ServletContext context = request.getServletContext();
+ WebappInfo webappInfo = ComponentConfig.getWebappInfo((String) context.getAttribute("_serverId"), UtilHttp.getApplicationName(request));
if (userLogin != null && webappInfo != null && webappInfo.isAutologinCookieUsed()) {
Cookie autoLoginCookie = new Cookie(getAutoLoginCookieName(request), userLogin.getString("userLoginId"));
