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

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-09-02 17:30:36 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Daniel Berrange 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

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 Berrange 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
*** 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();
+     }

Comment 2 Daniel Berrange 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.