Table of Contents

Class SessionData

Namespace
Fluxzy.Rules.Session
Assembly
Fluxzy.Core.dll

Holds session data (cookies and headers) for a single domain. Thread-safe for concurrent access.

public class SessionData
Inheritance
SessionData
Inherited Members

Constructors

SessionData(string)

public SessionData(string domain)

Parameters

domain string

Properties

Cookies

Cookies stored for this session (name -> SessionCookie)

public ConcurrentDictionary<string, SessionCookie> Cookies { get; }

Property Value

ConcurrentDictionary<string, SessionCookie>

Domain

Domain this session belongs to

public string Domain { get; }

Property Value

string

Headers

Custom headers stored for this session (header name -> value)

public ConcurrentDictionary<string, string> Headers { get; }

Property Value

ConcurrentDictionary<string, string>

LastUpdated

Timestamp of last update

public DateTime LastUpdated { get; set; }

Property Value

DateTime

Methods

GetCookieHeaderValue()

Get cookie string for Cookie header (name1=value1; name2=value2)

public string GetCookieHeaderValue()

Returns

string

RemoveExpiredCookies()

Remove expired cookies from the session

public void RemoveExpiredCookies()

SetCookie(string, string, string?, DateTime?)

Add or update a cookie

public void SetCookie(string name, string value, string? path = null, DateTime? expires = null)

Parameters

name string
value string
path string
expires DateTime?

SetHeader(string, string)

Add or update a header

public void SetHeader(string name, string value)

Parameters

name string
value string