From what I can tell, JSESSIONID used to pass the session in the query string, and Sinatra does not have something like that, at least not easily accessible. Sinatra uses Rack to manage the session and, by default, uses a cookie to store all session data. There are other session parameters in Rack, such as memcached, where the unique session identifier is stored in a cookie, but even there are no Rack abstracts, so you never need to see the session identifier (although it is still available, see the documentation ).
If you want to go this route, take a look at the confusion with the Rack middleware in Sinatra, but if you only need a unique identifier, then it would probably be easier to create it yourself and save it in the session.
source share