there are 2 ways, at least to do this
... Userdata stored in Database
... Userdata stored in Cookie
most often BOTH Database and Cookie is involved
When a user login, Database is used to get password for a Username.
When successful login
script usually get more DATA than password out of this user record.
One such FIELD in user Database Table could be: 'user_page'
with location of this custom page.