$_SESSION and $_SERVER['REQUEST_URI'];

$_SESSION['login_return_url'] = $_SERVER['REQUEST_URI'];

session_register — Register one or more global variables with the current session.

<?php
// Use of session_register() is deprecated
$barney = "A big purple dinosaur.";
session_register("barney");

// Use of $_SESSION is preferred, as of PHP 4.1.0
$_SESSION["zim"] = "An invader from another planet.";

// The old way was to use $HTTP_SESSION_VARS
$HTTP_SESSION_VARS["spongebob"] = "He's got square pants.";
?>

Source: PHP.net

$_SERVER is one example of a predefined variable.

$HTTP_SERVER_VARS [deprecated] — Server and execution environment information

‘REQUEST_URI’ – The URI which was given in order to access this page; for instance, ‘/index.html’.

Source: PHP.net

Leave a Comment