It sounds like what you want is to create one master and on that master have a dynamic panel with two states. One state will have the login button and the other will have the logout button.
Then, you can place that master on two pages and initialize the state of the dynamic panel in the OnPageLoad event of the page. If you always know that it will be "logout" on a page, you can just use the action to set the dynamic panel state.
If you don't know if they are logged in or not on a page, you can use variables. These videos and articles might help to learn about variables, conditions, and OnPageLoad.
http://www.axure.com/p202_5.aspx
http://www.axure.com/p202_6.aspx