Assign a value to a $_SESSION variable uppon clicking on a button
<p>here is the story : I want to transfer an object from a page to an another (let's say from <code>list.php</code> to <code>product_details.php</code>)</p>

<p>I know you can achieve this using serialisation, and storing your object variable into a <code>$_SESSION</code> variable, assuming my product_details.php will load the class to retrieve methods.</p>

<p>However, I don't want to create as many <code>$_SESSION</code> variables as I have products in my list.php.</p>

<p>On my list.php, every product have its a href  button that  goes to <code>product_details</code> with a $_GET  (like  <code>&lt;a href="product_details.php?pid=15&gt;</code> )</p>

<p>I know I could just recreate a new object on my product_details.php with the <code>$_GET</code> value and an extra query on the database. I'm learning stuff and trying to handle new approaches.</p>

<p>My page <code>list.php</code> have only one object at a time, which is constructed and unset at every row. It can have as many objects as there are products if needed though.</p>

<p>The question is, how could I do (or which language should I use/learn) to make a given <code>&lt;a href="product_details.php?pid=15"&gt;</code> type button perform the following :</p>

<pre><code>$_SESSION['product'] = serialize($objProduct);
</code></pre>

<p>before it actually jumps to my product_details.php?</p>

<p>Thanks</p>