PDA

View Full Version : Echo Session: to track sessions held on each page


vanroojdotcom
03-20-2009, 03:19 AM
Last time I built eCart there was a handy tip in the old forum. Simply put a bit of code at the foot of your page and it will show the sessions held in your Browser. It helped me to track the user ID and the Cart Sessions / products session stored and when the session was cleared. You obviously deleted it when the website went live!

Anybody remember that?


many thanks
Vanrooj

CraigR
03-22-2009, 03:01 PM
are you thinking of var_dump($_SESSION); ?

vanroojdotcom
03-23-2009, 07:33 AM
Hi there
CraigR ~ just found the archive section and it's this one.

<?php
if (!isset($_SESSION)) {
session_start();
}
echo '<pre>';
print_r( $_SESSION );
echo '</pre>';
?>

It simply prints out which sessions are being held in the browser (makes it really easy to follow the lineage through to checkout because you know when the cart has been cleared and which IDs are being held, which helps to update favourite selections or change orders from pending to paid fro in the user's order history table). You obviously remove this code when it goes live.

many thanks
vanrooj