I faced the following problem that i wanted to share with you, I have a user control that populates a menu to be shown to the user, the menu is populated based on the user privileges. i wanted to cache this user control so that the menu population logic won't run for every page request, so i decided to cache the output of the user control based on the SessionID, to do this i added the following attribute to the control <%@ OutputCache Duration="1" VaryByCustom="Session" VaryByParam="None" %> the VaryByCustom attribute allows you to vary the cached output by your defined string, having specifying the "Session" as my defined string i had to override the HttpApplication.GetVaryByCustomString method in the Global.asax file Overrides Function GetVaryByCustomString( ByVal context As HttpContext, ByVal custom As String ) As String If custom = "Session" Then Return Session.SessionID Else