How is the url for a session page generated, please? E.g. for a path like
/projects/UHJvamVjdDozOA==/sessions/UHJvamVjdFNlc3Npb246MjUyNw%3D%3Din the url UHJvamVjdFNlc3Npb246MjUyNw%3D%3D seems specific to a session_id, anyone knows how is that generated?
The session page URL in Phoenix uses a base64-encoded global ID for the session, following the format /projects/<project_global_id> /sessions/<session_global_id> . The session_global_id (e.g., UHJvamVjdFNlc3Npb246MjUyNw%3D%3D) is generated by combining the type name (ProjectSession) and the session's database ID, then encoding this string in base64. This is a standard Relay global ID pattern used throughout Phoenix's GraphQL API, where the format is TypeName:ID and then base64-encoded for use in URLs and queries. For example, if the session's database ID is 2527, the string ProjectSession:2527 is base64-encoded to UHJvamVjdFNlc3Npb246MjUyNw==, which is then URL-encoded for the path. This approach ensures unique, opaque identifiers for sessions in the UI and API. For more, see the implementation in the ProjectSession GraphQL type and related Relay global ID usage.Would you like a step-by-step example of how to generate this ID in code?Sources:
- ProjectSession GraphQL type
- Relay global ID usage
馃挕聽Hint: Mention RunLLM in the thread for followups.
-
