You can use:
@SetProfileField([NoPersist];"MyVariable";@username)
This information is kept in the Notes client's cache and is only valid until the Notes user has logged out. It's meant as a replacement for using @SetEnvironment to put parameters in the notes.ini file. It also only seems to be valid windows/frames within the same Notes database, so each database seems to have its own profile doc cache.