Session Security Model
Poge implements session management to protect your data when you step away from your device. Unlike traditional web apps with server-side sessions, Poge’s sessions are entirely client-side and controlled by your browser.Session States
Poge has three session states:- Unlocked: You’ve entered your PIN and can access all features
- Locked: Session timeout or manual lock - requires PIN to unlock
- First-time setup: No PIN configured yet - requires initial setup
When locked, all your encrypted data remains in localStorage, but the application requires PIN re-entry before it can be decrypted and accessed.
PIN Protection
Setting Up Your PIN
During first-time setup (components/first-time-setup.tsx:171-181):
- Exactly 6 digits (numbers 0-9 only)
- Must be confirmed by entering twice
- Cannot be all zeros (000000) or sequential (123456) - though not enforced, strongly discouraged
How PIN Entry Works
Fromcomponents/pin-entry.tsx:17-122:
Failed Attempt Lockout
Fromcomponents/pin-entry.tsx:37-38:
- First 4 failures: Show remaining attempts
- 5th failure: Lock for 5 minutes
- During lockout: Cannot attempt PIN entry
- After lockout: Counter resets to 0 attempts
Auto-Lock Timeout
How Auto-Lock Works
Poge automatically locks your session after a configured period of inactivity. This protects your data if you walk away from your device.Activity Tracking
The following user interactions reset the inactivity timer:- Mouse movement
- Keyboard input
- Click events
- Touch events (mobile)
- Scroll events
Configuring Auto-Lock Timeout
From Settings → Security → Auto-lock Timeout (components/settings.tsx:428-449):
| Option | Value | Recommendation |
|---|---|---|
| 5 minutes | 300000 | Recommended for shared spaces |
| 15 minutes | 900000 | Balanced security/convenience |
| 30 minutes | 1800000 | Suitable for private offices |
| 1 hour | 3600000 | Low-security environments only |
| 2 hours | 7200000 | Not recommended |
| Never | -1 | Not recommended - disables auto-lock |
Default Setting: Poge defaults to 5 minutes of inactivity. This balances security and usability for most development workflows.
Session Timeout Warning
Fromcomponents/session-timeout-warning.tsx:17-108:
- Appears: 10 seconds before session expires
- Shows countdown: Real-time seconds remaining
- Two options:
- “Extend Session” - Resets the inactivity timer
- “Lock Now” - Immediately locks the app
Lock on Page Refresh
What It Does
When enabled, Poge automatically locks your session whenever the page is refreshed (F5) or reopened.Configuration
From Settings → Security → Lock on Page Refresh (components/settings.tsx:451-468):
Use Cases
Enable lock on refresh when:- Using Poge on a shared computer
- Working in a public space (coffee shop, coworking space)
- Company security policy requires it
- You frequently step away without closing the tab
- Using Poge on a private, secure device
- You frequently refresh during development
- Auto-lock timeout provides sufficient protection
- You find re-entering PIN after refresh disruptive
Even with lock on refresh disabled, you can always manually lock Poge using the “Lock App” button in Settings or the keyboard shortcut Ctrl+L (if implemented).
Changing Your PIN
When to Change Your PIN
Change your PIN if:- You suspect it has been compromised
- You used a weak PIN during setup (e.g., 123456)
- You shared your PIN with someone and want to revoke access
- Regular security policy requires periodic changes
- You want to use a stronger PIN
How to Change Your PIN
- Navigate to Settings → Security
- Click “Change PIN” button (
components/settings.tsx:417-426) - Enter your current PIN
- Enter your new 6-digit PIN
- Confirm your new PIN
components/change-pin-dialog.tsx (referenced but not provided in source):
Re-Encrypting Data After PIN Change
To fully re-encrypt all data with a new PIN:- Before changing PIN: Export all data (Settings → Data Management → Export All Data)
- Change your PIN
- Clear all data (Settings → Security → Clear All Data)
- Complete first-time setup with new PIN
- Import your backup file
Manual Lock
You can manually lock Poge at any time:Lock Button
Fromcomponents/settings.tsx:760-765:
- Located in Settings page header
- Immediately locks the session
- Requires PIN to unlock
- Does not clear any data - just locks access
When to Manually Lock
- Before stepping away from your computer
- When sharing your screen
- Before letting someone else use your computer briefly
- When auto-lock timeout is set to “Never” but you want to lock now
Manual locking is instant and doesn’t wait for auto-lock timeout. It’s a good habit to lock whenever you leave your workspace, even briefly.
Session Persistence
Session State Storage
Session state is stored in localStorage:"true"- Session is locked, PIN required"false"or absent - Session unlocked (if valid PIN hash exists)
Session State Scenarios
| Scenario | Session State | Behavior |
|---|---|---|
| First visit | No PIN hash | Show first-time setup |
| After setup | Unlocked | Full access to app |
| Manual lock | Locked | Show PIN entry screen |
| Auto-lock timeout | Locked | Show PIN entry screen |
| Page refresh (lock on refresh = on) | Locked | Show PIN entry screen |
| Page refresh (lock on refresh = off) | Remains unlocked | Continue where you left off |
| Browser restart | Locked (by default) | Show PIN entry screen |
Backup Encryption
When exporting data, you encrypt it with a separate password.Export Security
Fromcomponents/settings.tsx:131-188:
Backup Password vs. PIN
| Aspect | PIN | Backup Password |
|---|---|---|
| Purpose | Unlock app | Encrypt/decrypt backups |
| Length | 6 digits | Any length (recommended: 16+ characters) |
| Stored? | Hash only | Never stored |
| Used for | Deriving keys for localStorage | Deriving keys for .enc files |
| Recommendation | Random 6 digits | Long, random passphrase |
Import Security
Fromcomponents/settings.tsx:190-286:
Backup Best Practices
-
Strong backup passwords: Use 16+ character random passphrases
- Good:
correct-horse-battery-staple-2026 - Bad:
123456(same as PIN)
- Good:
-
Secure storage: Store
.encbackup files in:- Password manager (as secure note)
- Encrypted cloud storage (Dropbox, Google Drive with client-side encryption)
- USB drive in physical safe
- NOT: Unencrypted email, Slack, or public file shares
- Test restores: Periodically verify you can restore from backups
- Document recovery process: Keep backup password separate from backup file
-
Version control: Include date in filename (
backup-2026-03-04.enc)
Backup File Contents: The
.enc file contains ALL your data: database credentials, queries, history, and settings. Treat it with the same security level as your production database passwords.Security Status Indicators
Visual Security Feedback
Poge provides several UI indicators of your security status:- Lock icon in header: Shows locked/unlocked state
- “AES-256 Encrypted” badge: Visible during first-time setup
- Session countdown: Shows time remaining before auto-lock (in timeout warning)
- Failed attempts counter: Shows remaining attempts before lockout
Security Status Panel (Settings)
Fromcomponents/settings.tsx:482-502 (commented out in current version):
Advanced Session Management
Clearing All Data (Factory Reset)
Fromcomponents/settings.tsx:470-479:
- Deletes all encrypted data from localStorage
- Removes PIN hash
- Clears session state
- Resets preferences
- Cannot be undone without a backup
Forgotten PIN Recovery
Fromcomponents/pin-entry.tsx:220-257:
- Click “reset the application” on PIN entry screen
- Confirm you understand data will be deleted
- Application clears all localStorage and reloads
- Complete first-time setup with new PIN
- Optionally import a backup (if you have one with a known password)
Database Safety: Resetting Poge only affects data stored in your browser. Your actual PostgreSQL databases are never touched by Poge and remain safe.
Session Management Recommendations
For Personal Devices
- Auto-lock: 15-30 minutes
- Lock on refresh: Disabled (for convenience)
- Backup frequency: Weekly or after major changes
- Backup storage: Password manager or encrypted cloud storage
For Shared Devices
- Auto-lock: 5 minutes
- Lock on refresh: Enabled
- Backup frequency: Daily (or don’t use Poge on shared devices)
- Manual lock: Always lock when stepping away
For High-Security Environments
- Auto-lock: 5 minutes
- Lock on refresh: Enabled
- Use strong backup passwords (20+ characters)
- Regularly rotate PIN (monthly)
- Store backups in enterprise secret management systems
- Consider using Poge only for non-production databases
Troubleshooting
Session Won’t Unlock After Correct PIN
Possible causes:- PIN hash corrupted in localStorage
- Browser storage quota exceeded
- Browser privacy settings blocking localStorage
- Check browser console for errors (F12)
- Verify localStorage is enabled in browser settings
- Try importing a backup
- Last resort: Reset application and restore from backup
Auto-Lock Not Working
Possible causes:- Auto-lock set to “Never”
- Browser tab not active (some browsers throttle background tabs)
- User activity constantly resetting timer
- Verify auto-lock timeout setting (Settings → Security)
- Test by leaving tab inactive for configured duration
- Check browser console for JavaScript errors
Session Locks Too Frequently
Possible causes:- Auto-lock timeout too short
- Not enough user activity to reset timer
- Multiple Poge tabs competing for session state
- Increase auto-lock timeout (Settings → Security)
- Use only one Poge tab at a time
- Manually lock when done instead of relying on timeout
Next Steps
- Learn about AES-256 encryption details
- Review security best practices
- Understand encrypted backup format