Silvermoon logo

sm.set_cookie

sm.set_cookie is an API function which allows you to modify and create cookies.

Usage

sm.set_cookie(name,content,CookieConfig)

NOTE: set_cookie will change all unset cookie configuration to default! Make sure to save your cookie configuration to easily apply it.

local conf = CookieConfig({
  httpOnly = true,
  maxAge = 3600
})

sm.set_cookie("secret", "12345", conf)