How can I use a session consistently in a service and variable?
I suspect you're getting different session IDs because you're creating a new instance of HttpSessionService (which ultimately is a wrapper for PHP's session handling).

What you should be doing is using Craft's existing session off of craft()-&gt;httpSession and grab the existing PHP session ID with craft()-&gt;httpSession-&gt;getSessionID().

No need to call craft()-&gt;httpSession-&gt;open(), because Craft will automatically start the session as soon as the HttpSessionService gets loaded.