diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig
index 0abe949ac3..fa43c50201 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig
+++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig
@@ -34,6 +34,10 @@
Route name
{{ request_route }}
+
+ Has session
+ {% if collector.sessionmetadata|length %}yes{% else %}no{% endif %}
+
{% endspaceless %}
{% endset %}
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
@@ -109,6 +113,16 @@
{% include 'WebProfilerBundle:Profiler:bag.html.twig' with { 'bag': collector.responseheaders } only %}
+ Session Metadata
+
+ {% if collector.sessionmetadata|length %}
+ {% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': collector.sessionmetadata } only %}
+ {% else %}
+
+ No session metadata
+
+ {% endif %}
+
Session Attributes
{% if collector.sessionattributes|length %}
diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
index 4029d7cf4a..f7cf88eee3 100644
--- a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
+++ b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
@@ -59,6 +59,14 @@ class RequestDataCollector extends DataCollector
$content = false;
}
+ $sessionMetadata = array();
+
+ if ($request->hasSession()) {
+ $sessionMetadata['Created'] = date(DATE_RFC822, $request->getSession()->getMetadataBag()->getCreated());
+ $sessionMetadata['Last used'] = date(DATE_RFC822, $request->getSession()->getMetadataBag()->getLastUsed());
+ $sessionMetadata['Lifetime'] = $request->getSession()->getMetadataBag()->getLifetime();
+ }
+
$this->data = array(
'format' => $request->getRequestFormat(),
'content' => $content,
@@ -71,6 +79,7 @@ class RequestDataCollector extends DataCollector
'request_cookies' => $request->cookies->all(),
'request_attributes' => $attributes,
'response_headers' => $responseHeaders,
+ 'session_metadata' => $sessionMetadata,
'session_attributes' => $request->hasSession() ? $request->getSession()->all() : array(),
'flashes' => $request->hasSession() ? $request->getSession()->getFlashBag()->peekAll() : array(),
'path_info' => $request->getPathInfo(),
@@ -117,6 +126,11 @@ class RequestDataCollector extends DataCollector
return new ResponseHeaderBag($this->data['response_headers']);
}
+ public function getSessionMetadata()
+ {
+ return $this->data['session_metadata'];
+ }
+
public function getSessionAttributes()
{
return $this->data['session_attributes'];