read method
Retrieve session data
Implementation
@override
Future<Map<String, dynamic>?> read(String sessionId) async {
if (!_isConnected) {
throw StateError('Redis connection not available');
}
final key = 'session:$sessionId';
final result = await _command.send_object(['GET', key]);
if (result == null) {
return null;
}
try {
final dataStr = result.toString();
return jsonDecode(dataStr) as Map<String, dynamic>;
} catch (e) {
// Log error for debugging but don't expose internal details
return null;
}
}