diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp
index 84657d4..37527dd 100644
--- a/redfish-core/lib/redfish_sessions.hpp
+++ b/redfish-core/lib/redfish_sessions.hpp
@@ -46,14 +46,27 @@
 }
 
 inline void
-    handleSessionGet(crow::App& app, const crow::Request& req,
-                     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
-                     const std::string& sessionId)
+    handleSessionHead(crow::App& app, const crow::Request& req,
+                      const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                      const std::string& /*sessionId*/)
 {
+
     if (!redfish::setUpRedfishRoute(app, req, asyncResp))
     {
         return;
     }
+    asyncResp->res.addHeader(
+        boost::beast::http::field::link,
+        "</redfish/v1/JsonSchemas/Session/Session.json>; rel=describedby");
+}
+
+inline void
+    handleSessionGet(crow::App& app, const crow::Request& req,
+                     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+                     const std::string& sessionId)
+{
+    handleSessionHead(app, req, asyncResp, sessionId);
+
     // Note that control also reaches here via doPost and doDelete.
     auto session =
         persistent_data::SessionStore::getInstance().getSessionByUid(sessionId);
@@ -122,14 +135,25 @@
     return ret;
 }
 
-inline void handleSessionCollectionGet(
+inline void handleSessionCollectionHead(
     crow::App& app, const crow::Request& req,
     const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
 {
+
     if (!redfish::setUpRedfishRoute(app, req, asyncResp))
     {
         return;
     }
+    asyncResp->res.addHeader(
+        boost::beast::http::field::link,
+        "</redfish/v1/JsonSchemas/SessionCollection.json>; rel=describedby");
+}
+
+inline void handleSessionCollectionGet(
+    crow::App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
+{
+    handleSessionCollectionHead(app, req, asyncResp);
     asyncResp->res.jsonValue["Members"] = getSessionCollectionMembers();
     asyncResp->res.jsonValue["Members@odata.count"] =
         asyncResp->res.jsonValue["Members"].size();
@@ -235,15 +259,25 @@
 
     fillSessionObject(asyncResp->res, *session);
 }
+inline void handleSessionServiceHead(
+    crow::App& app, const crow::Request& req,
+    const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
+{
+
+    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
+    {
+        return;
+    }
+    asyncResp->res.addHeader(
+        boost::beast::http::field::link,
+        "</redfish/v1/JsonSchemas/SessionService/SessionService.json>; rel=describedby");
+}
 inline void
     handleSessionServiceGet(crow::App& app, const crow::Request& req,
                             const std::shared_ptr<bmcweb::AsyncResp>& asyncResp)
 
 {
-    if (!redfish::setUpRedfishRoute(app, req, asyncResp))
-    {
-        return;
-    }
+    handleSessionServiceHead(app, req, asyncResp);
     asyncResp->res.jsonValue["@odata.type"] =
         "#SessionService.v1_0_2.SessionService";
     asyncResp->res.jsonValue["@odata.id"] = "/redfish/v1/SessionService/";
@@ -300,6 +334,11 @@
 inline void requestRoutesSession(App& app)
 {
     BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/<str>/")
+        .privileges(redfish::privileges::headSession)
+        .methods(boost::beast::http::verb::head)(
+            std::bind_front(handleSessionHead, std::ref(app)));
+
+    BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/<str>/")
         .privileges(redfish::privileges::getSession)
         .methods(boost::beast::http::verb::get)(
             std::bind_front(handleSessionGet, std::ref(app)));
@@ -310,6 +349,11 @@
             std::bind_front(handleSessionDelete, std::ref(app)));
 
     BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/")
+        .privileges(redfish::privileges::headSessionCollection)
+        .methods(boost::beast::http::verb::head)(
+            std::bind_front(handleSessionCollectionHead, std::ref(app)));
+
+    BMCWEB_ROUTE(app, "/redfish/v1/SessionService/Sessions/")
         .privileges(redfish::privileges::getSessionCollection)
         .methods(boost::beast::http::verb::get)(
             std::bind_front(handleSessionCollectionGet, std::ref(app)));
@@ -330,6 +374,11 @@
             std::bind_front(handleSessionCollectionPost, std::ref(app)));
 
     BMCWEB_ROUTE(app, "/redfish/v1/SessionService/")
+        .privileges(redfish::privileges::headSessionService)
+        .methods(boost::beast::http::verb::head)(
+            std::bind_front(handleSessionServiceHead, std::ref(app)));
+
+    BMCWEB_ROUTE(app, "/redfish/v1/SessionService/")
         .privileges(redfish::privileges::getSessionService)
         .methods(boost::beast::http::verb::get)(
             std::bind_front(handleSessionServiceGet, std::ref(app)));
