From 057e66440bcf857b6a3020bf146f2544657f4270 Mon Sep 17 00:00:00 2001 From: mdb Date: Mon, 20 Oct 2003 00:49:04 +0000 Subject: [PATCH] Make it possible to configure the user manager not to convert host.domain cookies into .domain cookies so that dev.puzzlepirates.com and .puzzlepirates.com cookies won't conflict (I hope). git-svn-id: https://samskivert.googlecode.com/svn/trunk@1270 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/servlet/user/UserManager.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/servlet/user/UserManager.java b/projects/samskivert/src/java/com/samskivert/servlet/user/UserManager.java index db82d148..08838b80 100644 --- a/projects/samskivert/src/java/com/samskivert/servlet/user/UserManager.java +++ b/projects/samskivert/src/java/com/samskivert/servlet/user/UserManager.java @@ -1,5 +1,5 @@ // -// $Id: UserManager.java,v 1.24 2003/10/14 02:37:53 mdb Exp $ +// $Id: UserManager.java,v 1.25 2003/10/20 00:49:04 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -110,6 +110,9 @@ public class UserManager public UserManager (Properties config, ConnectionProvider conprov) throws PersistenceException { + // save this for later + _config = config; + // create the user repository _repository = createRepository(conprov); @@ -245,7 +248,11 @@ public class UserManager // stick it into a cookie for their browsing convenience Cookie acookie = new Cookie(USERAUTH_COOKIE, authcode); // strip the hostname from the server and use that as the domain - CookieUtil.widenDomain(req, acookie); + // unless configured not to + if (!"false".equalsIgnoreCase( + _config.getProperty("auth_cookie.strip_hostname"))) { + CookieUtil.widenDomain(req, acookie); + } acookie.setPath("/"); // expire in one month if persistent, else at the end of the // session @@ -282,6 +289,9 @@ public class UserManager rsp.addCookie(c); } + /** Our user manager configuration. */ + protected Properties _config; + /** The user repository. */ protected UserRepository _repository;