Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $inputCookie = JFactory::getApplication()->input->cookie;
- $value = $inputCookie->get($name = 'myCookie', $defaultValue = null);
- $cookieExists = ($value !== null);
- $inputCookie->set($name = 'myCookie', $value = '123', $expire = 0);
- $app = JFactory::getApplication();
- // Get the cookie
- $value = $app->input->cookie->get('myCookie', null);
- // If there's no cookie value, manually set it
- if ($value == null)
- {
- $value = HOWEVER YOU GET THE CART DATA
- }
- // Set the cookie
- $time = time() + 604800; // 1 week
- $app->input->cookie->set('myCookie', $value, $time, $app->get('cookie_path', '/'), $app->get('cookie_domain'), $app->isSSLConnection());
- JRequest::setVar($var, $value, 'cookie');
- JRequest::getString($var, $default, 'cookie')
Add Comment
Please, Sign In to add comment