Getting logged-in user details for DOLS off-line web client

Hi,

If I have an off-line user, I need to get the username so that I can deliver specific content. As @Username gives incorrect results, in Views, or on Pages too, is there another way I can retrieve the user’s name?

The best alternative i’ve found so far is to use the CGI variable “remote_user” but the problem is I need to edit and save a document before this variable is set. Instead I want the user to

see a subset of documents based on their username.

I’m desperate now, so any advice would be gratefully received…