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
This commit is contained in:
@@ -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
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -110,6 +110,9 @@ public class UserManager
|
|||||||
public UserManager (Properties config, ConnectionProvider conprov)
|
public UserManager (Properties config, ConnectionProvider conprov)
|
||||||
throws PersistenceException
|
throws PersistenceException
|
||||||
{
|
{
|
||||||
|
// save this for later
|
||||||
|
_config = config;
|
||||||
|
|
||||||
// create the user repository
|
// create the user repository
|
||||||
_repository = createRepository(conprov);
|
_repository = createRepository(conprov);
|
||||||
|
|
||||||
@@ -245,7 +248,11 @@ public class UserManager
|
|||||||
// stick it into a cookie for their browsing convenience
|
// stick it into a cookie for their browsing convenience
|
||||||
Cookie acookie = new Cookie(USERAUTH_COOKIE, authcode);
|
Cookie acookie = new Cookie(USERAUTH_COOKIE, authcode);
|
||||||
// strip the hostname from the server and use that as the domain
|
// 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("/");
|
acookie.setPath("/");
|
||||||
// expire in one month if persistent, else at the end of the
|
// expire in one month if persistent, else at the end of the
|
||||||
// session
|
// session
|
||||||
@@ -282,6 +289,9 @@ public class UserManager
|
|||||||
rsp.addCookie(c);
|
rsp.addCookie(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Our user manager configuration. */
|
||||||
|
protected Properties _config;
|
||||||
|
|
||||||
/** The user repository. */
|
/** The user repository. */
|
||||||
protected UserRepository _repository;
|
protected UserRepository _repository;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user