For example, in a web page there is an authentication system that displays an alert window with the user name, after he logged in. In this case we assume that the username is stored in a session variable ( $_SESSION['username']). - Using the first method, we use the following PHP code: