Forum Moderators: open
A couple of ideas maybe to... [1] store a cookie, depending on which tab has been picked, and check for that cookie when the page loads, and change accordingly.
[2] Or, have the option of a permalink.... a url of the form "/mypage.php?mytab=2" and check for this when the page loads. You could even link to this URL when they click on a tab. You're essentially storing something in the URL.
Either way, you need to have something stored somewhere.