backdrop-contrib / flag

Flag module for Backdrop CMS
0 stars 11 forks source link

Removing `session_api_available()` call #26

Closed laryn closed 2 years ago

laryn commented 3 years ago

In a separate thread aross states that his previous patch includes an unnecessary call to session_api_available() which can prevent flag from working with anonymous users (and session_api):

I already did some patching of session API, and what will happen now is that the module will attempt to start the session anyway (when get_sid is called). Actually, calling code shouldn't have to use session_api_available() because session_api_get_sid() already does that. I guess I didn't realize that at the time I patched Flag. What will happen is that session API "doesn't work" at the first request, but then tries to set a cookie via $_SESSION. If the client accepts that cookie and sends it with the next request, then Session API works as expected.

It sounds like this module should remove the session_api_available() call completely if I am reading that right.

herbdool commented 2 years ago

I've removed session_api_available().