Setting a cookie

Dad.

Well-known member
Hey all,

Was wondering how to set a cookie using (I'm assuming there is a built-in function) XenForo, as I was hoping to be able to do it without loading the jQuery cookie plugin. Could someone provide a basic example of doing this (I'm not the best javascript developer in the world, I'm not quite a master yet :P).

Thanks!
 
How are you wanting to do it? It could be done via PHP:
PHP:
XenForo_Helper_Cookie::setCookie('cookieName', cookieinfo, timeout);
XenForo_Helper_Cookie::deleteCookie('cookieName');
 
Hey there, I want to do with javascript. I can do it the long way or I can import jQuery cookie plugin, but figured there was a way to do it with XenForo and just thought I'd found out how :)
 
Ah thanks a lot, $.setCookie() and $.getCookie() :D, I couldn't find it until I beautified the xenforo.js file, thanks a lot! (think my find function was buggy)
 
Top Bottom