SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Anyone have any advice on the best way of tracking the recent sites a user has visited?

As part of my overridden Global Navigation delegate control, I'd like to create something similar to a breadcrumb, but instead displays the last 4 sites (SPWeb objects) the user visited regardless of hierarchical relationship.


share|improve this question

You need to build something to get this to work. In you custom global nav you could either store the navigation history in a cookie, in a db, in-memory or whatever you prefer.

share|improve this answer
I ended up enabling Session variables and using that method. Does anyone have any words of warning regarding SharePoint and using Session state? I am a little leary of it because it is turned off by default. – andrew.petersen15 Aug 18 '11 at 13:34
up vote 0 down vote accepted

Enabling session state would have worked (I successfully implemented it this way first). But since I am working with a Standard license I was able to add a custom multivalued string property to the user profile property bag.

Then inside my delegate control I access the property with the following:

   SPServiceContext serviceContext = SPServiceContext.GetContext(SPContext.Current.Site);
   UserProfileManager profileManager = new UserProfileManager(serviceContext);
   UserProfile user = profileManager.GetUserProfile(false);
   ProfileValueCollectionBase siteValues = user.GetProfileValueCollection("LastFourSitesProperty");
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.