Safe way to get Anonymous Session ids

I'm using rapido.plone to get the Session id.
What's the difference between A:


(saw the example here:

and B.

portal = context.api.portal.get()
sdm = portal.session_data_manager
return sdm.getBrowserIdManager().getBrowserId(create=True)

(saw the example here: followed by a note to suggest that this is bad for performance)

More importantly, since B appears to be a bad idea is A safe? (trying to figure it out now).

1 Like