How can I design a function that will track the previous page a user has viewed. It will be should be designed to be called on each page.
I will be using a cookies for sure and also they should expire at the end of the visit.
How to achieve that ? I am new to JavaScript 🙁
If you can explain why you need it, we may find a better solution.
You can use histroy.back() function, i think this would help you.
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_his_back