اختبار الكوكيز

المفتاح القيمة الإجراء
language ar
DARTSESSID c6a1be673c526986fd6eabe3b2ebba60
  • عرض example/lib/widgets/example/auth.j2.html
  • التحكم example/lib/controllers/home_controller.dart
  • وحدة التحكم في المصادقة example/lib/controllers/auth_controller.dart
  • الموجه example/lib/route/web_route.dart
        
Future<String> exampleAddCookie() async {
  var name = rq.get<String>('name', def: '');
  var value = rq.get<String>('value', def: '');
  var safe = rq.get<bool>('safe', def: false);
  var action = rq.get<String>('action', def: 'add');

  if (action == 'delete') {
    // إزالة الكوكي
    rq.removeCookie(name);                  
  } else if (action == 'add' && name.isNotEmpty && value.isNotEmpty) {
    // إضافة كوكي
    rq.addCookie(name, value, safe: safe);  
  }

  return exampleCookie();
}