title: How to get the Session ID from a Zend_Auth session?
body: <p>Using the default <a href="http://framework.zend.com/manual/1.12/en/zend.auth.html" rel="nofollow">Zend_Auth</a> session storage (PHP Sessions), it creates a session ID and puts it in a cookie. If I want to get at the authenticated user's username (identity), the <code>Zend_Auth::getInstance()-&gt;getIdentity()</code> method gets that. However, I want to get at the user's session ID. I can get at it just by looking at <code>$_COOKIE</code>, or using <code>session_id()</code> but that seems hackish, and if I ever moved away from PHP Session storage might it break? So what's the best way to get the current session ID of the Zend_Auth session?</p>