Repository navigation
Conversation
|
80666f1 to
62db86e
Compare
62db86e to
c561071
Compare
c561071 to
db8a6ab
Compare
5932c7d to
6b07618
Compare
6b07618 to
93bb449
Compare
93bb449 to
d5e211b
Compare
There was a problem hiding this comment.
2 issues found across 16 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="news/+session-harness.bugfix.md">
<violation number="1" location="news/+session-harness.bugfix.md:1">
P3: This fragment reads as an instruction to configure a hostname, but AppHarness now sets the backend URL to `localhost` itself. Describe the change instead, e.g. that AppHarness now points the dev frontend at `localhost`, so browser cookies stay same-site in tests.</violation>
</file>
<file name="docs/api-routes/sessions.md">
<violation number="1" location="docs/api-routes/sessions.md:64">
P3: This describes the `__Host-` name as universal, but non-loopback HTTP development uses the bare cookie name because `_cookie_name()` disables the prefix when the cookie is insecure. Qualify this sentence to apply only to secure cookies so deployment and cookie-debugging guidance matches the implementation.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| @@ -0,0 +1 @@ | |||
| Use the same hostname for the development AppHarness frontend and backend so browser cookies remain same-site. | |||
There was a problem hiding this comment.
P3: This fragment reads as an instruction to configure a hostname, but AppHarness now sets the backend URL to localhost itself. Describe the change instead, e.g. that AppHarness now points the dev frontend at localhost, so browser cookies stay same-site in tests.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At news/+session-harness.bugfix.md, line 1:
<comment>This fragment reads as an instruction to configure a hostname, but AppHarness now sets the backend URL to `localhost` itself. Describe the change instead, e.g. that AppHarness now points the dev frontend at `localhost`, so browser cookies stay same-site in tests.</comment>
<file context>
@@ -0,0 +1 @@
+Use the same hostname for the development AppHarness frontend and backend so browser cookies remain same-site.
</file context>
| Use the same hostname for the development AppHarness frontend and backend so browser cookies remain same-site. | |
| AppHarness now points the development frontend at `localhost` for the backend API, so browser cookies remain same-site during tests. |
| Cookies use `Secure; HttpOnly; SameSite=None; Partitioned; Path=/`, no Domain, | ||
| and an app-specific `__Host-` name. Set `api_url` to the public backend URL, |
There was a problem hiding this comment.
P3: This describes the __Host- name as universal, but non-loopback HTTP development uses the bare cookie name because _cookie_name() disables the prefix when the cookie is insecure. Qualify this sentence to apply only to secure cookies so deployment and cookie-debugging guidance matches the implementation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/api-routes/sessions.md, line 64:
<comment>This describes the `__Host-` name as universal, but non-loopback HTTP development uses the bare cookie name because `_cookie_name()` disables the prefix when the cookie is insecure. Qualify this sentence to apply only to secure cookies so deployment and cookie-debugging guidance matches the implementation.</comment>
<file context>
@@ -0,0 +1,140 @@
+
+## Origins, cookies, and embedding
+
+Cookies use `Secure; HttpOnly; SameSite=None; Partitioned; Path=/`, no Domain,
+and an app-specific `__Host-` name. Set `api_url` to the public backend URL,
+including when TLS terminates at a reverse proxy. Cookies are not scoped by
</file context>
| Cookies use `Secure; HttpOnly; SameSite=None; Partitioned; Path=/`, no Domain, | |
| and an app-specific `__Host-` name. Set `api_url` to the public backend URL, | |
| Secure cookies use `Secure; HttpOnly; SameSite=None; Partitioned; Path=/`, no Domain, | |
| and an app-specific `__Host-` name; non-loopback HTTP development uses an insecure | |
| cookie without the `__Host-` prefix. Set `api_url` to the public backend URL, |
| from reflex_base.session import SessionToken | ||
|
|
||
| async with app.modify_state( | ||
| rx.BaseStateToken(client_token, MyState), |
There was a problem hiding this comment.
The server-side example passes positional arguments to BaseStateToken, but its inherited constructor requires keyword arguments. Copying it raises TypeError before app.modify_state runs. Use rx.BaseStateToken(ident=client_token, cls=MyState).
| rx.BaseStateToken(client_token, MyState), | |
| rx.BaseStateToken(ident=client_token, cls=MyState), |
Exercise session ownership in real servers and browsers, migrate synthetic clients to server-issued credentials, and document deployment and rollout.
The backend-path app runs under enforcement across development/production and zero/one/two-level prefixes. It covers immediate hydration during held cookie exchange, shared/duplicate tabs, uploads, failed exchange recovery with retained or cancelled uploads, idle short-TTL renewal, backend restarts, and cross-site iframe persistence. EmbedPlugin coverage also runs under enforcement. Production restarts preserve their worker and compile-suppression settings.
A real Granian test verifies state events while cookie exchange is held and state continuity on reconnect. It uses
rx.Stateand asserts it leaves no direct BaseState subclass behind for later integration apps. Benchmark reconnects reuse cookies and bound tokens, with issuance outside measured event latency.The guide covers app-bound credentials, persistent/rotating signing keys, POSIX permissions and Windows ACLs, origin configuration, partitioned cookies, embedding, migration modes, SYSTEM/anonymous authority, idle renewal, retry/cancellation, and readiness during cookie replacement. Existing reverse-proxy/api_transformer facilities handle rate limiting.
Review order: #7361 → #7362 → #7363 → #7364. Rebased on main
d02ba5409; #7360 is already merged. Companion: reflex-dev/reflex-enterprise#240.Validation:
pyright reflex testspass. Minimum-dependency checks pass for reflex, reflex-base, and reflex-components-core. Stub generation makes no tracked changes.playground-0.8.23job fails on that older release's missing greenlet dependency. Current-head playground and size checks pass. Large CI matrices are still running after the final pushes; cancelled duplicate runs also temporarily report failed gate checks.All substantive feedback is addressed. Review-thread replies explain the intentional connection-lifetime authority policy and declined hypothetical/style-only requests. Final adversarial review found no additional code blockers.
Related to ENG-12920, ENG-12921, ENG-9088.