Usually when someone logs in, you store the UserID in the session. Then you can bind that session variable to a column in the orders and/or orderdetails page by updating the "Store Cart Summary in Database" and "Store Cart Details in Database" server behaviors on the confirm.php page.