Skip to content

ICookieService

Namespace: SlottyMedia.Backend.Services.Interfaces

Provides a contract for setting cookies on the clients server

public interface ICookieService

Methods

SetCookie(String, String, Int32)

Should set a cookie on the clients browser

ValueTask SetCookie(string name, string value, int days)

Parameters

name String
Name of the cookies

value String
Value of the cookie

days Int32
Expiration offset in days

Returns

ValueTask
Returns a valuetask

GetCookie(String)

Gets a cookie

ValueTask<string> GetCookie(string name)

Parameters

name String
Name to identify cookie

Returns

ValueTask<String>
Returns a ValueTask of type string

RemoveCookie(String)

Removes a cookie on the client side by setting its duration below zero

ValueTask<string> RemoveCookie(string name)

Parameters

name String
Name to identify cookie

Returns

ValueTask<String>
Returns the cookie which was deleted