Unfortunately you cannot access session variables when substituting.
I already answered this in the comments of the blog post, but here is the answer again:
Session state is not available, but authentication information is available as the request is authenticated prior to output cache resolution. In fact the samples above work exclusively with authentication information. Query string is also available.
In a future version we may provide the option to force loading session state as well, but for the time being you have to work around it.
There are several possible ways to avoid using session state. You can use database to store temporary user info, you can retrieve the session id form the cookies and use it as key to store user info in the Cache instead of the Session object, you could create your own session handling or use query string instead.
If you use the cache object to store session data, don’t forget to set appropriate expiration.
the Telerik team
Check out Telerik Trainer
, the state of the art learning tool for Telerik products.