Bug 111802 - Login cookie name should be unique to a server instance
Summary: Login cookie name should be unique to a server instance
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Web Application Framework
Classification: Retired
Component: other
Version: nightly
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: ccm-bugs-list
QA Contact: Jon Orris
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-12-10 11:01 UTC by Daniel Berrangé
Modified: 2007-04-18 17:00 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-02 17:30:36 UTC
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2003-12-10 11:01:47 UTC
Description of problem:
A shared (or even a personal) development server will typically have
many instances of CCM operational. The spec for cookies says that
their names are unique within a domain - there is no scope for
including a port number there (some browsers do allow it, but that's
not part of the spec & IE specifically doesn't allow it).

There is however a simple solution to this problem, which is instead
of simply setting a cookie named 'ad_user_login' we can prepend the
name of the site hostname &/ port number, eg
'dev.london.redhat.com-9002-login'.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Start two servers on a single machine, but different port
2. Login to one server
3. Login to the other server
4. Go back to a page on the first server
  
Actual results:
You are logged out

Expected results:
You are still logged in.

Additional info:

Comment 1 Daniel Berrangé 2004-01-05 16:16:10 UTC
The following is sufficient to provide uniqueness of cookies across
all dev servers on a single host.

dan@camden$ p4 diff -dc
//core-platform/dev/src/com/arsdigita/kernel/security/CookieLoginModule.java
====
//core-platform/dev/src/com/arsdigita/kernel/security/CookieLoginModule.java#6
-
/var/ccm-devel/dev/dan/aplaws-rickshaw/core/src/com/arsdigita/kernel/security/CookieLoginModule.java
====
***************
*** 16,21 ****
--- 16,24 ----
  package com.arsdigita.kernel.security;
  
  import org.apache.log4j.Logger;
+ import javax.security.auth.login.LoginException;
+ 
+ import com.arsdigita.web.Web;
  
  /**
   * Logs in a user if the user has a valid authentication cookie.
***************
*** 35,38 ****
--- 38,47 ----
      public CookieLoginModule() {
          super(new CookieManager());
      }
+     
+     protected String getCredentialName()
+         throws LoginException {
+         return super.getCredentialName() + "_" + 
+             Web.getConfig().getHost().getPort();
+     }
  }
dan@camden$ 


Comment 2 Daniel Berrangé 2006-09-02 17:30:36 UTC
Closing old tickets



Note You need to log in before you can comment on or make changes to this bug.