Skip to content

feat: update anonymous chat cookie settings for cross-site compatibility#1236

Merged
MODSetter merged 2 commits intomainfrom
dev
Apr 16, 2026
Merged

feat: update anonymous chat cookie settings for cross-site compatibility#1236
MODSetter merged 2 commits intomainfrom
dev

Conversation

@MODSetter
Copy link
Copy Markdown
Owner

@MODSetter MODSetter commented Apr 16, 2026

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR updates the anonymous chat cookie configuration to support cross-site requests by implementing conditional SameSite and Secure cookie attributes. When the backend is served over HTTPS (detected via the BACKEND_URL config), cookies are set with SameSite=None and Secure=true to allow cross-domain requests between frontend and backend. In non-HTTPS environments, the settings fall back to SameSite=Lax for backward compatibility.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/app/routes/anonymous_chat_routes.py

Need help? Join our Discord

Analyze latest changes

- Implemented dynamic SameSite and Secure cookie settings based on the backend URL context.
- Enhanced cookie handling to ensure proper functionality in cross-domain scenarios.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
surf-sense-frontend Building Building Preview, Comment Apr 16, 2026 9:38am

Request Review

@MODSetter MODSetter merged commit ba2a2fd into main Apr 16, 2026
5 of 8 checks passed
Copy link
Copy Markdown

@recurseml recurseml Bot left a comment

Choose a reason for hiding this comment

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

Review by RecurseML

🔍 Review performed on 7d6c7c4..4e68565

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (1)

surfsense_backend/app/routes/anonymous_chat_routes.py

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