Pricing Plan Purchase Help!

I sell club memberships using Pricing Plans on my website - this is so I can allow people to pay incrementally. In order to bypass the necessity to login I am using the authentication.generateSessionToken(email) method to create an authenticated session.

The flow is as follows:

  1. Call authentication.generateSessionToken(email) on the Backend to retrieve token
  2. Call authentication.applySessionToken(sessionToken) on the Frontend to login the user
  3. Call checkout.createOnlineOrder(...) on the Backend to create the order
  4. Call wixPay.startPayment(orderObject.wixPayOrderId, ...) on the frontend to start the payment process.

This all worked perfectly up until very recently.

Now however, it seems that when I call authentication.applySessionToken(sessionToken) on the frontend, the Backend session is not authenticated immediately, and the checkout.createOnlineOrder(...) call fails. The page needs to be refreshed before the Backend recognises the authenticated session, and the call then succeeds.

Is this a bug?