Session metrics are only as good as the session IDs behind them. If a user opts out, comes back and opts in again, and the SDK reuses an old session ID, one visit can look like a session that lasted days. Average session length, sessions per user and retention curves all get distorted without any error being raised.
Amplitude Android Kotlin SDK 1.35.0 (16 October 2026) fixes stale session IDs carrying over when a user opts back in on cold start, by validating saved sessions. The next release, 1.36.0 (21 October 2026), adds shared identity properties with an atomic setter, so several SDK instances can share and sync user identity. It also fixes selectable Jetpack Compose controls such as Checkbox and Switch being missed by autocapture.
Why This Matters
Consent changes are common in privacy-conscious apps. Every opt-in after a long gap is a chance for old state to leak into new data. The error is invisible in totals but obvious in the long tail of session durations.
Data Points to Track
sdk_versionper sessionsession_idandsession_start_timestampsession_duration_seconds, including the 99th percentileopt_in_state(opted in, opted out, returned from opt-out)days_since_last_sessionat cold startsessions_per_user_per_dayinstance_namewhen you run more than one SDK instanceidentity_sync_conflictwhen two instances disagree on user IDcheckbox_switch_interaction_countafter upgrade
Setup Steps
- Pull the distribution of session durations and note how many exceed 24 hours.
- Upgrade the Kotlin SDK to 1.35.0 or later, and preferably 1.36.0.
- Send an
opt_in_stateproperty onsession_start. - Create a chart of session duration by
days_since_last_sessionfor users who opted back in. - If you use several instances, move shared user identity to the new atomic setter and record the instance name.
- Re-test Compose screens to confirm switches and checkboxes now produce interaction events.
- Compare sessions per user before and after for two weeks.
Actionable Insights
Look at the longest sessions. A cluster of multi-day sessions among users who opted back in is the signature of the stale ID bug. After the fix, that tail should shrink.
Check whether retention changed. If old sessions were being merged into new ones, some users looked more active than they were. A small dip after the upgrade is a correction, not a regression.
Watch for identity conflicts between instances. A rising conflict count shows that two parts of your app disagree about who the user is.
Common Mistakes to Avoid
Do not backfill or edit historical sessions to hide the change. Annotate the release date on your charts instead.
Do not treat new switch and checkbox events as a surge in engagement. Part of the rise is better capture.