Magento 1.9中的会话变量

I am trying to create a session variable that I can pass to the checkout in Magento 1.9.

Its basically to pass coupons automatically to the checkout for certain pages, I have the add coupon working but can't seem to pass a coupon code correctly.

I have tried the following:

Simply add ?coupon_code=$coupon to the string, but this seems to get stripped possibly due to url rewrites for languages.

$session = Mage::getSingleton("core/session", array("name"=>"frontend"));     //load session variables 
$session->setData("data", $coupon); //save your data in custom session variable

but when I try to get this session in the cart it fails to find anything.

Can someone point me in the right direction for what I am doing wrong?

Please use 'checkout/session' instead of core/session