During the FIX session lifetime, state changes occur. The OnixS::FIX::Session class exposes the OnixS::FIX::Session::state member to determine in which state it currently resides.
The following table describes all possible FIX session states that can occur during its lifetime, as well as what a specific state means for a session with a particular role.
| State | Description |
| Role == Acceptor | Role == Initiator |
| Disconnected | The session is disconnected. |
| LoginInProgress | The session is waiting for the initial Logon message. | The initial Logon message was sent, and the session is waiting for the acknowledgment Logon message. |
| Active | The session is fully established (after the successful Logon exchange). |
| Reconnecting | N/A (only session-initiator can be in this state). | Session-initiator is trying to restore the telecommunication link. |
| LogoutInProgress | The initial Logout message was sent, and the session is waiting for the acknowledgment Logout message. |
The diagrams show nominal role-specific logon, reconnection, and logout flows between the public OnixS::FIX::SessionState values. They do not enumerate every API-driven transition or internal protocol-processing state.
Initiator Session State Diagram

Acceptor Session State Diagram

Tracking Session State Change
OnixS::FIX::ISessionListener class exposes OnixS::FIX::ISessionListener::onStateChange virtual function for its users.
Overriding this member in descendant classes provides an ability to be notified about all changes in state of a particular session.
Example
{
public:
void onStateChange(SessionState::Enum newState, SessionState::Enum prevState, Session*) override
{
std::clog
<< "\nSession's state is changed"
<< ". Previous state was " << SessionState::toString(prevState)
<< ", new state is " << SessionState::toString(newState)
<< std::endl;
}
};