Ajax call killing current active session


Im trying to call the confluence API with a js script embedded in a page via HTML Bob Swift plugin.

The API call works pretty well. However once the Ajax call is done. The current session used is killed and I need to reconnect.

Does anyone encountered a similar issue ?