If I let a user session expire/tab stay open for a long time, then return and try searching, it fails with a console error. How to fix?

If I let a user session expire/tab stay open for a long time, then return and try searching, it fails with a console error. How to fix?

The error occurs when our security controller is protecting your website from speculative load. Please reload the page before typing in the search field.