Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitzart/blazor.cookies
Working with browser cookies in Blazor United
https://github.com/bitzart/blazor.cookies
blazor blazor-server blazor-webassembly browser-cookies cookie cookies csharp dotnet js-interop jsruntime
Last synced: about 2 months ago
JSON representation
Working with browser cookies in Blazor United
- Host: GitHub
- URL: https://github.com/bitzart/blazor.cookies
- Owner: BitzArt
- License: mit
- Created: 2024-03-02T10:15:25.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-28T14:11:07.000Z (2 months ago)
- Last Synced: 2024-10-28T14:35:02.428Z (2 months ago)
- Topics: blazor, blazor-server, blazor-webassembly, browser-cookies, cookie, cookies, csharp, dotnet, js-interop, jsruntime
- Language: C#
- Homepage:
- Size: 133 KB
- Stars: 32
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Tests](https://github.com/BitzArt/Blazor.Cookies/actions/workflows/Tests.yml/badge.svg)
[![NuGet version](https://img.shields.io/nuget/v/BitzArt.Blazor.Cookies.svg)](https://www.nuget.org/packages/BitzArt.Blazor.Cookies/)
[![NuGet downloads](https://img.shields.io/nuget/dt/BitzArt.Blazor.Cookies.svg)](https://www.nuget.org/packages/BitzArt.Blazor.Cookies/)## Overview
**BitzArt.Blazor.Cookies** is a nuget package that simplifies working with browser cookies in Blazor applications.
> 🍪
> We also have an [authentication package](https://github.com/BitzArt/Blazor.Auth) for Blazor that simplifies implementing custom JWT-based authentication & authorization in your Blazor applications while using this package under the hood.You can use cookies in your Blazor applications as a way to store user's unique information, such as preferences, settings, or session / authentication data.
- Built for dotnet 8+
- Supports all Blazor United render modes
- Supports Blazor prerendering| Blazor Rendermode | Support |
|-------------------------|:-------:|
| Static SSR | ✔️ |
| Interactive Server | ✔️ |
| Interactive WebAssembly | ✔️ |
| Interactive Auto | ✔️ |### Installation
- Install the following package in your Blazor Server project:
```
dotnet add package BitzArt.Blazor.Cookies.Server
```- Add this line to your Server project `program.cs`:
```csharp
builder.AddBlazorCookies();
```- Install the following package in your Blazor Client project:
```
dotnet add package BitzArt.Blazor.Cookies.Client
```- Add this line to your Client project `program.cs`:
```csharp
builder.AddBlazorCookies();
```### Usage
- Inject `ICookieService` in any of your Services / Blazor Components
- Use `ICookieService` to interact with user's cookies.## License
[![License](https://img.shields.io/badge/mit-%230072C6?style=for-the-badge)](https://github.com/BitzArt/Blazor.Cookies/blob/main/LICENSE)