Magento – Identify checkout success page

magento-1.8

when i echo

"Mage::app()->getFrontController()->getRequest()->getActionName();" 

on

"checkout/onepage/success" 

page it gives me values as "index".
As per url i suppose output should be "success".

I want to identify if current page is checkout success page, so i tried to use the above code, but it gives undesired output.

Best Answer

Magento page layout is matching with FullActionName().

Mage::app()->getFrontController()->getAction()->getFullActionName();

If this code returns true

Mage::app()->getFrontController()->getAction()->getFullActionName() === 'checkout_onepage_success'

it means that this page is the checkout success page