Login sequence diagram
Messages between browser, web server and database during sign-in, with an alt box for right and wrong passwords.
The diagram
Reading it step by step
- 1. 'User' sends a request to 'Browser': 'Enter ID and password'.
- 2. 'Browser' sends a request to 'Web server': 'Sign-in request'.
- 3. 'Web server' sends a request to 'Database': 'Look up member'.
- 4. 'Database' replies to 'Web server': 'Member record'.
- [alt: Password matches]
- 5. 'Web server' replies to 'Browser': 'Session token'.
- 6. 'Browser' replies to 'User': 'Home screen'.
- 7. 'Web server' replies to 'Browser': 'Error'.
- 8. 'Browser' replies to 'User': 'Ask to retry'.
Shape by shape
| Shape | Symbol | Connections |
|---|---|---|
| User | Actor | → Browser(Enter ID and password) · ← Browser, Browser |
| Browser | Participant and lifeline | → Web server(Sign-in request), User(Home screen), User(Ask to retry) · ← User, Web server, Web server |
| Web server | Participant and lifeline | → Database(Look up member), Browser(Session token), Browser(Error) · ← Browser, Database |
| Database | Participant and lifeline | → Web server(Member record) · ← Web server |
Symbols used here
| Symbol | Meaning |
|---|---|
| Participant and lifeline | A box on top and a dashed line below. |
| Actor | A human participant; a stick figure. |
| Synchronous message | A call that waits; solid line, filled head. |
| Reply | The answer; dashed line, open head. |
| Combined fragment | loop, alt and opt boxes. |
Diagram text
Paste this text into the editor to get the same picture, then change the names to fit your own work.
# Login sequence diagram
sequenceDiagram
actor U as User
participant B as Browser
participant S as Web server
participant D as Database
U->>B: Enter ID and password
B->>S: Sign-in request
S->>D: Look up member
D-->>S: Member record
alt Password matches
S-->>B: Session token
B-->>U: Home screen
else Wrong password
S-->>B: Error
B-->>U: Ask to retry
end