In login button click maintain the name of user in session.
in master page load write below code
if(session["Username"]!=null)
lblname.text=session["Username"].tostring();
[AJ]
I would prefer using session variables as properties. Please create some properties for getting/setting
session["Username"]
instead of directly accessing it, which will increase the readability or maintainability. Either you can create a property in the same class or can use a common SessionHelper class.