From the team behind aidrop.it — one workspace to build, host, and keep changing your code.

Keep users signed in across deployments by giving the replacement process access to the same session records and signing keys. The browser must also send its cookie to the address serving the new release. A deployment should preserve valid sessions while your application continues to enforce expiry, logout, and changes to account access.

In a shop, a customer signs in and opens their saved cart while you release a new checkout page. Their next request reaches a new process. Start with the state map for that journey: the cookie, session record, and cart have different storage and expiry rules.

Store sessions where the next process can read them

For server-side sessions, the browser carries an opaque identifier and your application looks up the corresponding record. Put those records in a shared store if users should remain signed in after process replacement. Keeping them in web-process memory or temporary files makes their lifetime depend on that process, regardless of the cookie's expiry date.

A database-backed store follows the database's lifetime across releases. With cache-backed sessions, eviction or a cache restart may require another login. Django's session documentation describes both options and a database-backed cache with fallback. Choose according to the experience you promise.

Use the same configured signing key across processes that must accept the same signed cookies. Generating a fresh key during startup can invalidate cookies after a restart, even when session records remain intact. Store the key as a runtime secret and plan rotation using the framework's supported method for accepting older signatures during a transition.

Inspect the browser's outgoing request as well as the server's session lookup. A cookie scoped to your preview hostname will not follow the customer to a different custom domain. Set the domain and path for the intended address. MDN's cookie reference explains these browser rules and the Secure, HttpOnly, and SameSite attributes.

Test continuity together with logout

Sign in before a release and request a protected page after the new process starts. For server-side sessions, log out and confirm that the application rejects the previous session. Signed cookie sessions need their own revocation policy: clearing one browser's cookie does not invalidate a stolen copy. Test continuity and access withdrawal with production settings.

OWASP's session management guidance calls for server-enforced expiry and session renewal after authentication or privilege changes. Keep those controls while fixing deployment logouts. Record lookup failures without cookie contents or secret values. A session-store outage needs a service-error path; treating it as an invalid session can log users out during a temporary failure.

A session continuity check

Keep this record beside the application's runtime settings. Name the store and secret variable, then record the observed results from a release. Use test accounts and keep session identifiers out of the record. The per-service secret list helps identify which processes need the signing key.

SESSION CONTINUITY CHECK
Session model: server-side record / signed cookie
Record store, if used:
Signing-key variable name, without its value:
Cookie hostname and path:
Idle and absolute expiry rules:

[ ] Sign in on release A; access a protected page on release B
[ ] Repeat after replacing the process without changing code
[ ] Confirm expiry and the chosen logout/revocation behavior
[ ] Check permission changes take effect as designed
[ ] Check the custom domain receives the intended cookie
[ ] Store outage produces a bounded error, not a new empty session

Observed failure: cookie absent / signature rejected / lookup failed
Release and responsible owner:

FAQ

Why do users get logged out after a deployment? Common causes include sessions stored in process memory, a signing key generated at startup, and a changed cookie hostname or path. Check the outgoing cookie, signature validation, and session lookup to identify which part failed.

Does a JWT solve session persistence? A self-contained token can survive process replacement if the new process accepts its signing key and claims. You still need expiry, secure storage, and a plan for withdrawing access before the token expires.

Can aidrop.it preserve my application's login sessions? aidrop.it can host the application with an attached PostgreSQL resource and configured runtime values. Your application must implement the session store, declare its required secret names, and manage expiry and logout. Temporary container files and process memory do not survive replacement.

Before the next deploy

Get it running from the session you are already in

Connect your coding agent over MCP and ask it to deploy. aidrop builds the repository and runs it on a public address; when a build or the app fails, the log says why, and your agent fixes it and builds again.