The middleware assigns a unique identifier for session. The session id doesn't depend of session or whatever else. It only need cookies to be turned on.
The session id is reassigned after client close a browser. Identifier of the session could be read from request: request.current_session_id.
You can setup name of the cookie in yours settings module (FLASH_SESSION_COOKIE_NAME).
request.current_session_id is lazy. It means the ID will be assigned and cookie will be returned to client after first usage.