jQuery AJAX and PHP variables

jQuery AJAX and PHP variables

Hey guys, I have a quick question.


I am using jQuery AJAX to login and logout. When the user is logged in, I want to show the user's username, which I store in a session. So, $_SESSION['username'] is equal to a given username. I am pretty new to jQuery, so so far, I have only displayed information that I have echoed out in a PHP script. Is it possible to somehow pass other information back to jQuery from the PHP script. Say I have a login.php and somepage.php. Somepage.php has the login form and uses login.php to handle the login process. Then the form on somepage.php is updated depending on the login result. Is there any way to pass the username back to somepage.php without making a script that simply echoes out the username?


Thanks in advance! :)
Andy