I have a log of web pages viewed by users. This is to facilitate diagnosis of problems, and review user activity (which can be revealing! and lead to improvements to the site)
I log lots of data to enable recreating what the user did - all the Form variables, cookies, etc.
I also log when the page finished rendering in the clients browser (with a WebBot image).
One of the things that I have difficulty with is where the user presses BACK and then picks a different route to continue their browsing from.
e.g. from the log I can see that the user viewed PageA, PageB then PageC - but there may be no route from PageB to PageC and actually the user went BACK to PageA and then forward to PageC.
I have a unique ID for each page rendered, which I could use as a "Came From" indicator.
One thought I had was to store that ID in a cookie (via Javascript). But before I start trying stuff I'd appreciate any advice you have.