java/code
Tomas Lestach
tlestach at fedoraproject.org
Fri Jun 22 13:35:35 UTC 2012
java/code/src/com/redhat/rhn/frontend/servlets/PxtCookieManager.java | 12 +++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 9938adaa32021f950d3014637254c27fa611aa88
Author: Tomas Lestach <tlestach at redhat.com>
Date: Fri Jun 22 12:03:45 2012 +0200
829790 - handle spoiled browsers separatelly
otherwise they just ignore our cookies
diff --git a/java/code/src/com/redhat/rhn/frontend/servlets/PxtCookieManager.java b/java/code/src/com/redhat/rhn/frontend/servlets/PxtCookieManager.java
index dfc08b1..77fb025 100644
--- a/java/code/src/com/redhat/rhn/frontend/servlets/PxtCookieManager.java
+++ b/java/code/src/com/redhat/rhn/frontend/servlets/PxtCookieManager.java
@@ -70,13 +70,23 @@ public class PxtCookieManager {
// there's no need to use domain and besides that it causes trouble,
// when accessing the server within the local network (without FQDN)
// pxtCookie.setDomain(request.getServerName());
- pxtCookie.setMaxAge(timeout);
+ if (!userAgentContains(request, "msie")) {
+ pxtCookie.setMaxAge(timeout);
+ }
pxtCookie.setPath(DEFAULT_PATH);
pxtCookie.setSecure(ConfigDefaults.get().isSSLAvailable());
return pxtCookie;
}
+ private boolean userAgentContains(HttpServletRequest request, String browserId) {
+ String userAgent = request.getHeader("User-Agent");
+ if (userAgent != null) {
+ return userAgent.toLowerCase().contains(browserId);
+ }
+ return false;
+ }
+
/**
* Retrieves the pxt cookie from the request if one is included in the request.
*
More information about the spacewalk-commits
mailing list