Please make sure you use this doc when adding the PHP snippet: How to add custom code snippets - HivePress Help Center
Also, please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users.