Skip to content

Conversation

@ryanfowler
Copy link
Owner

Implement named sessions that persist cookies across invocations. Sessions are stored as JSON files in the user's cache directory (~/.cache/fetch/sessions/ on Linux, ~/Library/Caches/fetch/sessions/ on macOS). The session name is configurable via --session/-S flag or per-host in the config file.

@ryanfowler ryanfowler requested a review from Copilot January 29, 2026 20:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements persistent cookie storage through named sessions, allowing cookies to be saved and reused across fetch invocations.

Changes:

  • Added session management functionality with JSON-based persistence in the user's cache directory
  • Integrated session support into the CLI via --session/-S flag and configuration system
  • Implemented comprehensive test coverage for session functionality including cookie persistence, expiration handling, and session isolation

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
main.go Integrated session configuration into the main request flow
internal/session/session.go Implemented core session management including load/save operations and cookie jar wrapper
internal/session/session_test.go Added unit tests for session validation, persistence, expiration, and corruption handling
internal/fetch/fetch.go Integrated session loading/saving into the request lifecycle with error handling
internal/config/config.go Added session configuration parsing and validation
internal/client/client.go Added SetJar method to enable cookie jar configuration
internal/cli/app.go Added --session/-S CLI flag for specifying session names
integration/integration_test.go Added integration tests for session persistence, expiration, and isolation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Implement named sessions that persist cookies across invocations.
Sessions are stored as JSON files in the user's cache directory
(~/.cache/fetch/sessions/ on Linux, ~/Library/Caches/fetch/sessions/
on macOS). The session name is configurable via --session/-S flag
or per-host in the config file.
@ryanfowler ryanfowler merged commit a69cdc7 into main Jan 29, 2026
10 checks passed
@ryanfowler ryanfowler deleted the sessions branch January 29, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant