ChatGPT Session Token Extractor
A userscript that simplifies extracting ChatGPT session tokens for use with legacy iOS 15 applications like ChatGPTWebV15.
🎯 Purpose
This script was created to streamline the token extraction process for users who need to manually inject session cookies into iOS 15 legacy ChatGPT apps due to broken OAuth flows on older iOS versions.
Instead of manually navigating through Chrome DevTools → Application → Storage → Cookies to find and copy the __Secure-next-auth.session-token
, this script provides a one-click solution.
✨ Features
- 🔑 One-Click Token Extraction: Floating button for instant token copying
- 📋 Smart Clipboard Integration: Automatic clipboard copying with fallback support
- ✅ Visual Feedback: Button changes to checkmark when successful
- 🔔 Toast Notifications: Clear success/error messages
- 📱 iOS 15 Optimized: Perfect for ChatGPTWebV15 and similar legacy apps
- 🔍 Verbose Logging: Detailed console logs for debugging
- 🎨 Smooth Animations: Polished UI with hover effects and transitions
🚀 How It Works
- Install this userscript via Tampermonkey/Greasemonkey
- Visit chatgpt.com and sign in normally
- Click the floating 🔑 button in the bottom-right corner
- Paste the copied token directly into your iOS 15 ChatGPT app
🎯 Target Use Case
Perfect for users of:
- ChatGPTWebV15 iOS app
- Other legacy iOS 15 ChatGPT applications
- Any app requiring manual session token injection
🔧 Technical Details
- Domains: Works on
chatgpt.com
and chat.openai.com
- Cookie Target: Extracts
__Secure-next-auth.session-token
- Compatibility: Modern browsers with clipboard API support + fallback
- Performance: Lightweight, no external dependencies
- Privacy: All processing happens locally, no data sent anywhere
🎨 UI/UX
- Floating Button: Non-intrusive 60px circular button
- Smart Positioning: Bottom-right corner, stays out of the way
- Visual States: Hover effects, success animations, clear feedback
- Notifications: Toast messages with success/error indicators
- Responsive: Works in both desktop and mobile browser views
💻 Console Logging
Enable verbose logging to see detailed operation info:
- Token extraction attempts
- Clipboard operations
- DOM manipulation events
- Error handling and fallbacks
🔗 Related
This script pairs perfectly with the ChatGPTWebV15 iOS app for users stuck on iOS 15 who need a working ChatGPT solution.
Made with ❤️ for the iOS 15 ChatGPT community
Changelog
Version 1.0.0 (2025-01-29)
🎉 Initial Release
Core Features:
- ✅ One-click ChatGPT session token extraction
- ✅ Floating 🔑 button UI with smooth animations
- ✅ Smart clipboard integration with automatic fallback
- ✅ Toast notification system for user feedback
- ✅ Visual success indicators (button turns green with checkmark)
- ✅ Support for both
chatgpt.com
and chat.openai.com
Technical Implementation:
- ✅ Robust cookie parsing for
__Secure-next-auth.session-token
- ✅ Modern Clipboard API with legacy
document.execCommand
fallback
- ✅ Duplicate button prevention system
- ✅ Comprehensive error handling and user messaging
- ✅ CSS animations and transitions for polished UX
Developer Features:
- ✅ Verbose console logging for debugging
- ✅ Detailed operation tracking and error reporting
- ✅ Clean code structure with comprehensive comments
- ✅ MIT license for open source compatibility
UI/UX Design:
- ✅ Non-intrusive floating button (bottom-right, 60px)
- ✅ Gradient background with hover effects
- ✅ 4-second auto-dismiss notifications
- ✅ Token length validation and preview in logs
- ✅ Smooth scale animations on interaction
iOS 15 Optimization:
- ✅ Perfect compatibility with ChatGPTWebV15 app workflow
- ✅ Streamlined token extraction process (replaces 5-step manual process)
- ✅ Immediate clipboard readiness for mobile app pasting
- ✅ Success confirmation with token character count
Browser Compatibility:
- ✅ Modern browsers with Clipboard API support
- ✅ Legacy browser support via fallback methods
- ✅ Cross-platform compatibility (Mac, Windows, Linux)
- ✅ Mobile browser support for responsive design
Installation Note: Requires Tampermonkey, Greasemonkey, or compatible userscript manager.
Compatibility: Tested on Chrome, Firefox, Safari, and Edge browsers.