What are the potential issues with using base64_encode to store the current URL in PHP?

Using base64_encode to store the current URL in PHP can potentially lead to security vulnerabilities as it can easily be decoded. To solve this issue, you can use PHP's urlencode function to encode the URL before storing it.

// Encode the current URL using urlencode
$currentURL = urlencode($_SERVER['REQUEST_URI']);