I am creating a product database/site with php and mysql. I have started down the road of using a session variable to store my current record id for later reference on future pages. As I have gotten a little further it has dawned on me that this may not be the ideal method as when I want to display a link to a different product, I don't have an easy way to update the session variable to the new id.

Imagine if you will that you were on a product page for product id 73. The session variable would be $\_SESSION['id'] = 73. Now you perform a search in the system and find a new product you want to view. You click the link and are redirected to the "product page" which is expecting to access the session variable to know which product to display, but at this point the variable is still set to 73.

Is the only/best way to make this process work with GET and by appending my variable to the url string? What is the recommended process for this scenario? I was trying to avoid using GET because I thought session variables were the preferred method for this type of thing and I was trying to have a clean URL string.