Answers.Body: <p>Old post, I know, but we've recently published a plugin to achieve this for a similar problem we were facing.</p>
  
  <p><a href="https://github.com/madebymutual/SessionExposer" rel="nofollow noreferrer">SessionExposer plugin</a> can help you achieve this. To get the Session ID in the template you use</p>
  
  <pre><code>{{ craft.sessionExposer.sessionId }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-29T17:06:27.377Z
Answers.Text: Any idea if this plugin is still available somewhere? Need to do this on a legacy Craft2 site.
Answers.UserDisplayName: erwinheiser
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-30T08:05:21.977Z
Answers.Text: @erwinheiser yes I've restored it at https://github.com/madebymutual/SessionExposer now, please note it's archived and entirelty unsupported. But hopefully it works for you
Answers.UserDisplayName: Mutual
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-01T10:05:29.247Z
Answers.Text: That's awesome, many many thanks! I'll definitely check it out.
Answers.UserDisplayName: erwinheiser
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-01T17:56:15.623Z
Answers.Text: works as advertised, thanks again!
Answers.UserDisplayName: erwinheiser
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-11T15:12:49.027Z
Answers.LastActivityDate: 2017-03-11T15:12:49.027Z
Answers.UserDisplayName: Mutual
Answers.Body: <p>I assume you're referring to the PHP session ID (wrapped by <a href="http://buildwithcraft.com/classreference/services/HttpSessionService" rel="nofollow">HttpSessionService</a>)?</p>
  
  <p>If so, the answer is no - Craft doesn't expose that to the templates.  You'd have to write a plugin that did.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-28T14:34:54.717Z
Answers.Text: Yes, I has hoping to grab the session to send along for a unique identifier for some tracking purposes. Looked at the request.getCookie() also but no luck.
Answers.UserDisplayName: Derrick Grigg
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-27T22:07:50.607Z
Answers.LastActivityDate: 2015-05-27T22:07:50.607Z
Answers.UserDisplayName: Brad Bell
Body: <p>Is there a way to get the session id from craft.session in a twig template without needing to create a new filter?</p>
  
Tags: <session>
Title: Getting session Id in twig template
ThreadText: # Getting session Id in twig template
  
  (Asked by: username_0 on 2015-05-27)
  
  Is there a way to get the session id from craft.session in a twig template without needing to create a new filter?
  
  **Tags:** session
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-03-11. Score: 3
  
  Old post, I know, but we've recently published a plugin to achieve this for a similar problem we were facing.
  
  [SessionExposer plugin](https://github.com/madebymutual/SessionExposer) can help you achieve this. To get the Session ID in the template you use
  
  ```
  {{ craft.sessionExposer.sessionId }}
  
  ```
  
  > **Comments:**
  > **username_2**: Any idea if this plugin is still available somewhere? Need to do this on a legacy Craft2 site.  
  > **username_1**: @username_2 yes I've restored it at https://github.com/madebymutual/SessionExposer now, please note it's archived and entirelty unsupported. But hopefully it works for you  
  > **username_2**: That's awesome, many many thanks! I'll definitely check it out.  
  > **username_2**: works as advertised, thanks again!  
  
  ---
  
  ### Answer by username_3 on 2015-05-27. Score: 1
  
  I assume you're referring to the PHP session ID (wrapped by [HttpSessionService](http://buildwithcraft.com/classreference/services/HttpSessionService))?
  
  If so, the answer is no - Craft doesn't expose that to the templates. You'd have to write a plugin that did.
  
  > **Comments:**
  > **username_0**: Yes, I has hoping to grab the session to send along for a unique identifier for some tracking purposes. Looked at the request.getCookie() also but no luck.  
  
  ---
  
  