The problem that I can remember of is that ASP.NET templates provided by ASP.NET teams in ASP.NET 4, used a form to logout the users. The template that I downloaded to learn ASP.NET had the same thing and I always hated why did they have to submit a form to a page where they could use the hyperlink. The form was something like (if I remember clearly)
<form method="post" id="form" action="~/Logout.cshtml">
<a href="javascript:document.getElementById('#form').submit()">Logout</a>
</form>
Perhaps, you are submitting that logout form (the hyperlink may be active, tab focus or whatever). Which in turn logs out the user. I would recommend that you debug your application and see what is going wrong. Even if the above case is true in your case, even then the enter key must not be set to it, implicitly.