Apparently there is a change from version 9.20 on. I found that when checking the newest version of the ForgotPassword module.
String[] mxVersion = RuntimeVersion.getInstance().toString().split("\\.");
if (Integer.parseInt(mxVersion[0]) >=9 && Integer.parseInt(mxVersion[1]) >= 20) {
//use reflection to call the addCookie method with 7 parameters, which was added in 9.20
@SuppressWarnings("rawtypes")
Class[] methodSignature = {String.class, String.class, String.class, String.class, int.class, boolean.class, boolean.class};
Method addCookie = response.getClass().getMethod("addCookie", methodSignature);
addCookie.invoke(response, Core.getConfiguration().getSessionIdCookieName(), session.getId().toString(), "/", "", -1, true, true);
} else {
response.addCookie(Core.getConfiguration().getSessionIdCookieName(), session.getId().toString(), "/", "", -1, true);
Does anyone have more information on what exactly was changed in 9.20?