Table of Contents

Method BuildCookieHeaderValue

Namespace
Sisk.Core.Http
Assembly
Sisk.Core.dll

Builds the cookie header value and returns an string from it.

public static string BuildCookieHeaderValue(Cookie cookie)

Parameters

cookie Cookie

The Cookie instance to build the cookie string.

Returns

string

BuildCookieHeaderValue(string, string, DateTime?, TimeSpan?, string?, string?, bool?, bool?, string?)

Builds the cookie header value and returns an string from it.

public static string BuildCookieHeaderValue(string name, string value, DateTime? expires = null, TimeSpan? maxAge = null, string? domain = null, string? path = null, bool? secure = null, bool? httpOnly = null, string? sameSite = null)

Parameters

name string

The cookie name.

value string

The cookie value.

expires DateTime?

The cookie expirity date.

maxAge TimeSpan?

The cookie max duration after being set.

domain string

The domain where the cookie will be valid.

path string

The path where the cookie will be valid.

secure bool?

Determines if the cookie will only be stored in an secure context.

httpOnly bool?

Determines if the cookie will be only available in the HTTP context.

sameSite string

The cookie SameSite parameter.

Returns

string