Feature: Tenant-Isolated Sessions and Authentication #4

Closed
opened 2026-06-25 19:30:21 +00:00 by psycodepath · 0 comments
Owner

Motivation

Authentication and session cookies must be isolated so that a session from one tenant is not valid on another tenant.

Description

Configure PHP session cookie paths/domains to be isolated per tenant subdomain, and partition session variables or user entities by tenant database.

User Story

As a user, I want my session to be valid only on my household's subdomain so that I am not logged into other households.

Gherkin Feature

Feature: Tenant-Isolated Sessions
  As a security-conscious user
  I want my login session to be scoped to my subdomain
  So that other subdomains cannot hijack or share my session

  Scenario: Login is scoped to subdomain
    Given I log in on "family1.localhost"
    When I visit "family2.localhost"
    Then I should be prompted to log in on "family2.localhost"

Acceptance Criteria

  • Session cookie configurations scoped to the tenant-specific host/domain.
  • Logging out of one tenant does not affect sessions on other tenants.
  • Authentication queries map to the active tenant's database.
### Motivation Authentication and session cookies must be isolated so that a session from one tenant is not valid on another tenant. ### Description Configure PHP session cookie paths/domains to be isolated per tenant subdomain, and partition session variables or user entities by tenant database. ### User Story As a user, I want my session to be valid only on my household's subdomain so that I am not logged into other households. ### Gherkin Feature ```gherkin Feature: Tenant-Isolated Sessions As a security-conscious user I want my login session to be scoped to my subdomain So that other subdomains cannot hijack or share my session Scenario: Login is scoped to subdomain Given I log in on "family1.localhost" When I visit "family2.localhost" Then I should be prompted to log in on "family2.localhost" ``` ### Acceptance Criteria - [ ] Session cookie configurations scoped to the tenant-specific host/domain. - [ ] Logging out of one tenant does not affect sessions on other tenants. - [ ] Authentication queries map to the active tenant's database.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
psycodepath/hrp#4
No description provided.