Permalink
Browse files

Change time zone cookie to always be insecure

  • Loading branch information...
1 parent 9eca444 commit 33a46017765b67c0bef216479b11c07eb4ad0704 @hlship committed May 28, 2012
@@ -30,13 +30,4 @@
* "win2k-cold-2"). Defaults to "". If a theme is configured, then the {@link #SKIN} is ignored.
*/
public static final String THEME = "tapx.datefield.theme";
-
- /**
- * If true, then the cookie used to track the user's time zone (once identified) is secure.
- * Default is false.
- *
- * @since 1.2
- */
- public static final String SECURE_TIME_ZONE_COOKIE = "tapx.datefield.secure-timezone-cookie";
-
}
@@ -46,7 +46,6 @@ public static void contributeFactoryDefaults(MappedConfiguration<String, Object>
"classpath:/com/howardlewisship/tapx/datefield/jscalendar-1.0");
configuration.add(DateFieldSymbols.SKIN, "aqua");
configuration.add(DateFieldSymbols.THEME, "");
- configuration.add(DateFieldSymbols.SECURE_TIME_ZONE_COOKIE, false);
}
public static void contributeComponentClassResolver(Configuration<LibraryMapping> configuration)
@@ -14,12 +14,10 @@
package com.howardlewisship.tapx.internal.datefield.services;
-import com.howardlewisship.tapx.datefield.DateFieldSymbols;
import com.howardlewisship.tapx.datefield.services.ClientTimeZoneTracker;
import org.apache.tapestry5.internal.services.CookieSink;
import org.apache.tapestry5.ioc.ScopeConstants;
import org.apache.tapestry5.ioc.annotations.Scope;
-import org.apache.tapestry5.ioc.annotations.Symbol;
import org.apache.tapestry5.services.Cookies;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.Session;
@@ -42,20 +40,15 @@
private final Request request;
- private final boolean secure;
-
private TimeZone timeZone;
private boolean identified;
- public ClientTimeZoneTrackerImpl(Cookies cookies, CookieSink cookieSink, Request request,
- @Symbol(DateFieldSymbols.SECURE_TIME_ZONE_COOKIE)
- boolean secure)
+ public ClientTimeZoneTrackerImpl(Cookies cookies, CookieSink cookieSink, Request request)
{
this.cookies = cookies;
this.cookieSink = cookieSink;
this.request = request;
- this.secure = secure;
setupTimeZone();
}
@@ -129,7 +122,6 @@ public void setClientTimeZone(TimeZone timeZone)
Cookie cookie = new Cookie(COOKIE_NAME, timeZone.getID());
cookie.setPath(request.getContextPath() + "/");
cookie.setMaxAge(THIRTY_DAYS_IN_SECONDS);
- cookie.setSecure(secure);
cookieSink.addCookie(cookie);

0 comments on commit 33a4601

Please sign in to comment.