I had the same problem as Naples78 but I found why I can't logout and then login with a different user using a different ticket.
It's because when we lauch a new web session, the first time, the ticket provided in the url is used to authenticate the user.
At this moment, the user object is maintain in the session.The next time you try to enter a new ticket in the url, the ticket will be ignored and this is the user object in the web session that is used. (You can easily see that if try to open a new session with a different valid ticket, you will see that you will be connected with the other user).
In order to solve this problem, I forced Alfresco to use the ticket provided in the url and not the object in the web session. You have to overwrite the org.alfresco.web.app.servlet.AuthenticationHelper class.
In authenticate(ServletContext context, HttpServletRequest httpRequest, HttpServletResponse httpResponse, String ticket) method in order to not use the User object in session if the ticket is different.