it is becuse Yii does not create any component unless it is needed… when you call Yii::app()->session then session object is instantiated for the first time and cookie is set. Same with every component - database connection is not created unless you access Yii::app()->db, and so on.
maybe other actions have accessRules which check if user is logged, which initializes session in background… hard to tell without investigating your code.