Detect a logged in user

I want to detect if a visitor is logged in. If they are I want to display a "Welcome [name]...", if the user isn't logged in then I want to display a become a member button.
I would assume s2member has a isLoggedIn function or even a session I can detect. The php I can handle I'm just not sure how to detect if the user has logged in.
thanks,
I would assume s2member has a isLoggedIn function or even a session I can detect. The php I can handle I'm just not sure how to detect if the user has logged in.
thanks,