Sep 14, 2017 07:30 PM|Bashin|LINK
Hello Im need to make a function for Recently Viewed Pages for a website. I cannot put it in the database nor in a session.
So my question is do I have to store it in a Cookie Collection or is there a better option?
I have to keep the last 24 for a log page but in the bottom of regular pages I have to show the link of the latest 5 pages the
user have visited.
I have searched for it but not found anything with a satisfying answer.
This is probably the best example I have found
System.Collections.Specialized.NameValueCollection cookiecoll = new System.Collections.Specialized.NameValueCollection();
for(int i = 0 ; i < myList.count; i++)
cookiecoll.Add("item_" + i,myList[i] );
HttpCookie cookielist = new HttpCookie("MyListOfCookies");
But when I reload the page this only writes over the old cookie so what more needs to be done with this function to work the way a Recently Viewed Pages function should do!
Please help this is driving me nuts.