clearcookies.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class ClearCookies extends oxUBase
00007 {
00012     protected $_sThisTemplate = 'page/info/clearcookies.tpl';
00013 
00021     public function render()
00022     {
00023         parent::render();
00024 
00025         $this->_removeCookies();
00026 
00027         return $this->_sThisTemplate;
00028     }
00029 
00035     protected function _removeCookies()
00036     {
00037         if ( isset( $_SERVER['HTTP_COOKIE'] ) ) {
00038             $aCookies = explode( ';', $_SERVER['HTTP_COOKIE'] );
00039             foreach ( $aCookies as $sCookie ) {
00040                 $sRawCookie = explode('=', $sCookie);
00041                 setcookie( trim( $sRawCookie[0] ), '', time() - 10000, '/' );
00042             }
00043         }
00044         setcookie( 'language', '', time() - 10000, '/' );
00045         setcookie( 'displayedCookiesNotification', '', time() - 10000, '/' );
00046     }
00047 
00053     public function getBreadCrumb()
00054     {
00055         $aPaths = array();
00056         $aPath = array();
00057 
00058         $aPath['title'] = oxRegistry::getLang()->translateString( 'PAGE_INFO_CLEARCOOKIE_TITLE', oxRegistry::getLang()->getBaseLanguage(), false );
00059         $aPath['link']  = $this->getLink();
00060         $aPaths[] = $aPath;
00061 
00062         return $aPaths;
00063     }
00064 
00065 }