Skip to content

Add web.session.Persistence base class superseding the ISession interface#16

Merged
thekid merged 4 commits into
masterfrom
feature/remaining
Jan 4, 2026
Merged

Add web.session.Persistence base class superseding the ISession interface#16
thekid merged 4 commits into
masterfrom
feature/remaining

Conversation

@thekid
Copy link
Copy Markdown
Member

@thekid thekid commented Jan 4, 2026

use web\session\InFileSystem;

$sessions= new InFileSystem()->lasting(3600);
$session= $sessions->create();

$session->expires(); // time() + 3600

⚠️ This PR doesn't touch the ISession interface for obvious BC problems! Instead, it introduced a new web.session.Persistence base class with this method readily implemented. It supersedes the interface while implementing it for the time being.

@thekid
Copy link
Copy Markdown
Member Author

thekid commented Jan 4, 2026

The web.Session base class has the following declaration:

public abstract class web.Session {
  public abstract function id(): string
  public abstract function expires(): int
  public abstract function register(string $name, var $value): void
  public abstract function value(string $name, var $default): var
  public abstract function remove(string $name): void
  public abstract function destroy(): void
}

Maybe this method should be called expires() instead?

@thekid thekid changed the title Add remaining() method to sessions Add expires() method to sessions Jan 4, 2026
@thekid thekid added the enhancement New feature or request label Jan 4, 2026
@thekid thekid changed the title Add expires() method to sessions Add web.session.Persistence base class superseding the ISession interface Jan 4, 2026
@thekid thekid merged commit a094e38 into master Jan 4, 2026
16 checks passed
@thekid thekid deleted the feature/remaining branch January 4, 2026 19:35
@thekid
Copy link
Copy Markdown
Member Author

thekid commented Jan 4, 2026

thekid added a commit to xp-forge/cookie-sessions that referenced this pull request Jan 4, 2026
thekid added a commit to xp-forge/mongo-sessions that referenced this pull request Jan 4, 2026
thekid added a commit to xp-forge/redis-sessions that referenced this pull request Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant