If you mean that you want to display a different user URL for each user, and you just want to cache this URL, then you need to consider a few things:
If you are using a session value or a cookie, then you need a code for the possibility that the value is not present. Both the server session and the browser session may expire, and the user can still log in.
If you use a cookie, you might consider setting the cookie expiration time to the same as the validity cookie, but this still does not guarantee accessibility.
The cookie value will not be safe ; it can be changed. Session value will be safe.
If you use user form authentication, you can save the URL in the authentication cookie itself and then upload it to the user IPrincipal. I would advise against this, as I do not think this is the right place.
If you are simply trying to cache the URL, then as long as your code retrieves the data when this value is missing, the session value or cookie will be fine depending on the security level.
If I read this incorrectly and you just want to show / hide the link depending on whether the user is allowed or not, you can simply use
<% if (User.Identity.IsAuthenticated) { %> <a href="/MyPage">view my page</a> <% } %>
And your MyPage action in your controller displays a dedicated page for the user.
source share