Topic on Project:Support desk

Viruszany (talkcontribs)

Is there a way to set and read cookies using MediaWiki's built-in functions, or should I use PHP's setcookie() function?

This post was hidden by AhmadF.Cheema (history)
Ciencia Al Poder (talkcontribs)

From the WebRequest class (usually accessible in $wgRequest and various hooks) you can call the response() method which returns a WebResponse object where you can call the setCookie method.