In electronic commerce (e-commerce) sites that are executed on a single
e-commerce application, a user's session is only associated with a single
user identity for e-commerce site domain. Acting under a single identity
across the site may not be desired. There may be requirements to
associate an individual user with one or more separate identities within
parts of the site. Aspects of the invention provide a method, system and
computer program product for managing multiple user identities for a user
of an electronic commerce (e-commerce) site. The method comprises
defining the e-commerce site as one or more security domains; and in
response to a user's request to invoke an operation of the e-commerce
site: determining a one of the one or more security domains to which the
operation relates; performing one of a) creating a session and b) reusing
a session for the user automatically in accordance with the determined
security domain, said session associated with a user identity and a role
indicating privileges for invoking operations of the e-commerce site in
at least the determined security domain; and persisting said session for
reuse. The user's request may be received in association with one or more
sessions persisted for the user and a one of the sessions selected in
accordance with the determined security domain. In response, either a
session may be created or reused. Persisting may comprise providing one
or more cookies defining the session to the user for associating with a
subsequent request. In accordance with a feature of this aspect, the
e-commerce site may define each of the one or more security domains as a
hierarchy of organizations and assets owned by the organizations and the
determining a one of the one or more security domains to which the
operation relates may comprise evaluating the user's request in
accordance with the hierarchy.