The way to do this is via custom variable.
Basic Code:
piwikTracker.setCustomVariable(1, "Member", "<?php echo $username;?>", "visit"); piwikTracker.trackPageView();
visit scope will last for the session
Piwik Docs at: http://piwik.org/docs/custom-variables/