A cross-platform Swift Package Manager library providing RFC6265-compliant HTTP cookie management for Apple platforms, Linux, and Swift on Server frameworks.
- π― RFC6265 Compliant: Full implementation of HTTP State Management Mechanism specification
- π Cross-Platform: Pure Swift implementation supporting Apple platforms and Linux
- β‘ High Performance: UTF-8 level parsing with optimized cookie operations
- π Thread Safe: Actor-based concurrency model for safe concurrent access
- π₯οΈ Server Ready: Designed for Swift on Server frameworks (Vapor, Hummingbird)
- π Comprehensive: All standard cookie attributes with proper validation
This library implements the full RFC6265 specification including:
- β Cookie name/value extraction with proper token validation
- β Case-insensitive attribute parsing
- β Whitespace handling and trimming
- β Malformed input rejection
- β Exact domain matching
- β Subdomain matching with proper dot handling
- β Leading dot normalization
- β Public suffix protection
- β Path prefix matching
- β Default path handling
- β Case-sensitive path comparison
- β Expires: RFC-compliant date parsing (multiple formats)
- β Max-Age: Takes precedence over Expires
- β Secure: HTTPS-only cookie transmission
- β HttpOnly: Script access prevention
- β SameSite: CSRF protection
- β Longer paths first
- β Creation time ordering for equal paths
- Swift: 6.0 or later
- Platforms:
- macOS 10.15+
- iOS 13.0+
- watchOS 6.0+
- tvOS 13.0+
- Linux (Swift 6.0+)
Run the comprehensive test suite:
swift testThe library includes extensive RFC6265 compliance tests covering edge cases, malformed input, and cross-platform behavior.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Swift API Design Guidelines
- Maintain RFC6265 compliance
- Add tests for new functionality
- Update documentation for public APIs
- Ensure cross-platform compatibility
This project is licensed under the MIT License - see the LICENSE file for details.