What's the best way to do sso for a wordpress and asp.net site(same domain, maybe different sub

there is a way I can think about: using a cookie
1. after logged in wordpress, create a encrypt cookie with username string
2. from asp.net site decrypt the cookie and get username, if name exist, mark the user as loggedin, if not, insert a new record into user profile data and mark as loggedin.
Is it a good way?
Is there any better way?