クッキーテスト
キー | 値 | アクション |
---|---|---|
DARTSESSID | ea4b5e1537f46d2b8fee283a5b3747aa | |
language | ja |
-
表示 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();
}