Documentation Index
Fetch the complete documentation index at: https://docs.cocartapi.com/llms.txt
Use this file to discover all available pages before exploring further.
Dev note: This page needs improving.
Secure Storage
Here are recommended approaches for token storage, in order of security:-
HttpOnly Cookies (Most Secure)
- Protected from XSS attacks
- Automatic CSRF protection when configured properly
- Handled automatically by browsers
-
Web Workers + IndexedDB
- Isolated from main thread
- Protected from XSS
- More complex implementation
-
In-Memory Storage
- Cleared on page refresh
- Protected from XSS
- Requires state management solution
Server-Side Configuration
Your server should set cookies with secure options:Security Best Practices
- Always use HTTPS for token transmission
- Set appropriate cookie flags:
- HttpOnly
- Secure
- SameSite=Strict
- Implement CSRF protection
- Use short token expiration times
- Rotate refresh tokens