What you are seeking to do is reasonably easy, just an addition to the page with your login, which will take your username or similar and set the cookie using it.
By default sessions are created when someone logs into a website, this lasts until the browser is closed or they select Logout.
You can set sessions if this is all you need.
Cookies are intended when you wish to keep information for longer periods, such as a week, month or years.
I assume your form posts to a page which checks the username/password against the database then logs then in if they exist.
If so, then after this code and before any redirecting occurs, you need to add some code to set the cookie.
Below is a quick example from the link the other user gave you.
Response.Cookies("username")=Request("user_usernam e")
Response.Cookies("username").Expires=Date()+30
this sets a cookie called 'username' which has the name from the form and will expire in 30 days.
If you really only need it to last whilst they have the browser open or log out, then a Session is much better, as it does not need to store anything long term.
As above, after your log in script, just add
Session("username") = Request("user_username")
That will mean you know the user logged in and will allow you to show their Username at anytime whilst they are logged in.
I tend to set their ID from the database, as this means you can query their records without having to check or ask for more information.
This just requires a quick query following login for their record, although if you use their 'username' to identify them, then that is enough.
Whichever way you go, make sure the Session or Cookie code is not called until you are sure they have an account, i.e the code which checks has run and is positive. Else someone will just be able to use the site by trying to log in.
I hope that is useful, if you have any queries, send me a message

)