When a given user accesses any php script on your server, you have the opportunity to inspect and modify the $_SESSION variable. This is true if the page is accessed via AJAX or directly in the browser.
If you wanted to add a song to someone's play list, you might send them to this url:
http://yourdomain.com/index.php?new_song=purple+haze
Then in your code you can do this:
// you might want to use numbers for songs instead
$new_song_name = $_GET['new_song'];
// you should probably write some code here to make sure the song name is a valid one
// fetch the play list from the session var
session_start();
if (isset($_SESSION['playlist'])) {
$playlist = $_SESSION['playlist'];
} else {
// there was no play list before
$playlist = array();
}
// add the song to the playlist array
$playlist[] = $new_song_name;
// save the playlist back into session
$_SESSION['playlist'] = $playlist;