You can't set a session variable based on what button a user clicks, because Session data is stored on the server, not on the cookie.
What you can do is give each button a different GET variable, and then push that into the Session array when your page loads.
Original Page
<a onclick="javascript:window.location.href='http://www.another.page.com/?button=1'; return false;">
<a onclick="javascript:window.location.href='http://www.another.page.com/?button=2'; return false;">
<a onclick="javascript:window.location.href='http://www.another.page.com/?button=3'; return false;">
Other Page
<?php
if(isset($_GET['button']))
{
$_SESSION['button'] = $_GET['button'];
}
//..........process stuff.................
?>
Make sure to sanitize the GET
value though.