I found the problem; it is not about the base64, but rather about the session. It is not adding a session on the VPS, which is why it returns an error because the string returns "null". How can I fix this? Is there anything I need to install on my VPS?
The session depends on cookies. Check in your browser that you are receiving a cookie and that the cookie is not being deleted, may be you have some extreme privacy measure.