When you make a link from subdomain.mysite.com to mysite.com, pass in a variable X which equals the session id. Then, do as the PHP manual suggests:
session_start() creates a session or resumes the current one based on the current session id that's being passed via a request, such as GET, POST, or a cookie.