You can store the user's browsing data into browser cache with a key which can later be used to display the previously browsed data.
Many E-Commerce do this to populate collection's like: Recently Visited Product.
And also if you store the browsing history in your DB then its overhead for you to manage this, as same user may not return for forever also not every user uses static IP.
And you can see this in action in servlets on :
http://www.topshop.com/[
^]