A most easily usable cookie management library in Dart. With SweetCookieJar, you can easily manage cookie on your application.

Last update: May 19, 2022

sweet_cookie_jar

A most easily usable cookie management library in Dart!

pub package Dart

1. About

SweetCookieJar is an open-sourced Dart library.
With SweetCookieJar, you can easily manage cookie on your application.

SweetCookieJar is a library that extends the functionality of the official Cookie class. It also works with Responses in the http package, and even if multiple set-cookie are set in the response header, which is a weak point in the http package, SweetCookieJar can manage these cookie information very easily!

No more difficult implementation is needed to handle multiple set-cookie set in response header in Dart. Just pass the Responses to the constructor of SweetCookieJar!

1.1. Introduction

1.1.1. Install Library

With Dart:

 dart pub add sweet_cookie_jar

With Flutter:

 flutter pub add sweet_cookie_jar

1.1.2. Import It

import 'package:sweet_cookie_jar/sweet_cookie_jar.dart';

1.1.3. Use SweetCookieJar

void main() {
    // The cookie set in the response header
    // will be extracted by the constructor process.
    final cookieJar = SweetCookieJar.from(response: response);

    if (cookieJar.isEmpty) {
        // It means that there is no cookie information
        // in the response header.
        return;
    }

    // You can find cookie by name easily.
    final cookie = cookieJar.find(name: 'AWSALB');
    print(cookie.name);
    print(cookie.value);

    // Also you can get cookie as JSON format.
    print(cookie.toJson());

    if (cookie.isExpired) {
        // Do something when cookie is expired.
        return;
    }
}

1.2. License

Copyright (c) 2021, Kato Shinya. All rights reserved.
Use of this source code is governed by a
BSD-style license that can be found in the LICENSE file.

1.3. More Information

SweetCookieJar was designed and implemented by Kato Shinya.

GitHub

https://github.com/myConsciousness/sweet-cookie-jar
You might also like...

An app that helps you manage your Postcard Creator orders. Built with Flutter

mailman A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Jan 10, 2022

Flutter app that helps you manage your payments.

Flutter app that helps you manage your payments.

💵 PayFlow Screenshots | Tecnologias | Projeto | Licença 📸 Screenshots 🚀 Tecnologias Esse projeto foi desenvolvido com as seguintes tecnologias: Flu

Aug 18, 2022

Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.

Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.

GetWidget is a 100% free Flutter open-source UI Kit library built with Flutter SDK to make Flutter development easier and more joyful than ever. GetWi

Aug 15, 2022

Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.

Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.

GetWidget is a 100% free Flutter open-source UI Kit library built with Flutter SDK to make Flutter development easier and more joyful than ever. GetWi

Aug 13, 2022

Presentation-Remote-PC - Manage your presentation from your smart phone - Phone Client

Presentation-Remote-PC - Manage your presentation from your smart phone - Phone Client

Presentation-Remote-PC Manage your presentation from your smart phone - Phone Cl

Jan 25, 2022

QUICKNOTES is a simple Note taking app, you can easily manages your TODOs

QUICKNOTES is a simple Note taking app, you can easily manages your TODOs

QUICKNOTES is a simple Note taking app, you can easily manages your TODOs. It has a simple UI with Dark & Light Themes.

May 2, 2022

Sales representative and sales management system to manage sales representatives, goods, and sales.

Sales Rep and Sales Management app. This mobile app is used to manage daily activities of a wholesale business. Getting Started This project is a star

Jul 1, 2022

Group25 - A poultry farm management app built to help farmers manage poultry releated farm activies

Group25 - A poultry farm management app built to help farmers manage poultry releated farm activies

poultry A poultry farm management app built to help farmers manage poultry relea

Feb 15, 2022

Flutter Version Management: A simple cli to manage Flutter SDK versions.

fvm Flutter Version Management: A simple cli to manage Flutter SDK versions. Features: Configure Flutter SDK version per project or globally Ability t

Jul 23, 2022
Comments
  • 1. merge two `SweetCookieJar`s

    I'm working with https://github.com/jossef/requests which does http requests with seamless cookies in between them. I would like to use this package instead of a custom made CookieJar, but SweetCookieJar is lacking a way to edit the cookies inside it.

    So I would like a way to alter the cookies inside a SweetCookieJar (and also a way to merge 2 SweetCookieJars).

    This way a CookieJar can be altered with some newly set cookies by the server, and then resent on a new request.

    Reviewed by sehnryr at 2022-05-13 09:02

Related

A most easily usable RESAS API wrapper in Dart. With this library, you can easily integrate your application with the RESAS API.

A most easily usable RESAS API wrapper library in Dart! 1. About 1.1. What Is RESAS? 1.2. Introduction 1.2.1. Install Library 1.2.2. Import It 1.2.3.

Apr 7, 2022
A most easily usable Duolingo API wrapper in Dart. Duolingo4D is an open-sourced Dart library.

A most easily usable Duolingo API wrapper in Dart! 1. About Duolingo4D Duolingo4D is an open-sourced Dart library. With Duolingo4D, you can easily int

Jul 20, 2022
A most easily usable JSON wrapper library in Dart

A most easily usable JSON response wrapper library in Dart! 1. About 1.1. Introd

Jan 4, 2022
A most easily usable improvement rate calculator library in Dart.

A most easily usable improvement rate calculator library in Dart. With ImprovementRate, you can easily calculate improvement rate on your application.

Dec 27, 2021
AuthorizationHeader is an open-sourced Dart library. With AuthorizationHeader, you can easily manage authorization header on your application.

A most easily usable authorization header management library in Dart! 1. About 1.1. Supported 1.1.1. Authorization Header 1.1.2. Authorization Type 1.

Dec 24, 2021
Portarius is a free, open-source, cross-platform mobile application that allows you to manage your Portainer sessions.
Portarius is a free, open-source, cross-platform mobile application that allows you to manage your Portainer sessions.

Portarius [Latin: Porta/Door Arius/Keeper] Features User management See running/stopped containers (and also start/stop and restart them) See containe

Aug 1, 2022
changelog.dart provides a library and a command-line application to manage in the correct way the git metadata to build the changelog between two release
changelog.dart provides a library and a command-line application to manage in the correct way the git metadata to build the changelog between two release

changelog.dart ?? changelog.dart: a collection of tools to manages in a fashion way a repository as maintainer. ?? Project Homepage Table of Content I

Apr 2, 2022
A Flutter widget that checks and displays the version status of application and you can easily guide user to update your app
A Flutter widget that checks and displays the version status of application and you can easily guide user to update your app

A most easily usable Flutter widget about application version check! 1. About 1.

Dec 16, 2021
Flutter The lightest, easiest and most convenient route management!
Flutter The lightest, easiest and most convenient route management!

Language: English | 中文简体 nav_router nav_router is the simplest / lightweight / convenient routing management solution for flutter. It supports various

May 21, 2022
GetX - one of the most popular state management solution in flutter
GetX - one of the most popular state management solution in flutter

GteX Tutorial - Udemy GetX is one of the most popular state management solution in flutter. In addition to state management, GetX provides easy way to

May 18, 2022