llms_setcookie( string $name, string $value = '', int $expires, string $path = '', string $domain = '', bool $secure = false, bool $httponly = false )

Set a cookie.


Description Description

A pluggable wrapper for the native PHP function set_cookie().

The lifterlms-tests library plugs this function during unit testing so we can mock the returns of methods that set cookies and write tests for those functions.


Parameters Parameters

$name

(Required) The name of the cookie.

$value

(Optional) The value of the cookie.

Default value: ''

$expires

(Required) The time wehn the cookie expires as a Unix timestamp.

$path

(Optional) The path on the server where the cookie will be available.

Default value: ''

$domain

(Optional) The (sub)domain that the cookie is available to.

Default value: ''

$secure

(Optional) Indicates the cookie should only be transmitted over a secure HTTPS connection.

Default value: false

$httponly

(Optional) When true the cookie will only be made accessible through the HTTP protocol, preventing it from being accessed by scripting languages (such as Javascript).

Default value: false


Top ↑

Return Return

(boolean)


Top ↑

Source Source

File: includes/llms.functions.core.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
4.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.