# Kibana 7.10 : handling cookie on server side custom plugin

**URL:** <https://discuss.elastic.co/t/kibana-7-10-handling-cookie-on-server-side-custom-plugin/262770>\
**Category:** Kibana\
**Created:** [January 31, 2021, 10:42pm UTC](https://discuss.elastic.co/t/kibana-7-10-handling-cookie-on-server-side-custom-plugin/262770 "2021-01-31T22:42:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prathibha\_Y](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prathibha_y/32/95786_2.png) [@Prathibha\_Y](https://discuss.elastic.co/u/Prathibha_Y)\
**Post date:** [January 31, 2021, 10:42pm UTC](https://discuss.elastic.co/t/kibana-7-10-handling-cookie-on-server-side-custom-plugin/262770/1 "2021-01-31T22:42:03Z")

</div>

Hi ,

I am trying to add server side cookie for my custom plugin, this is the code but  
I am not able to get the server object from http\_server, I get this module not found error when i try to import HttpServiceSetup

import {  
PluginInitializerContext,  
HttpServiceSetup,  
CoreStart,  
Plugin,  
RequestHandlerContext,

Logger,  
IRouter  
} from '../../../src/core/server'

this line fails  
const { createCookieSessionStorageFactory } = HttpServiceSetup['createCookieSessionStorageFactory'];

const sessionStorageFactory = await createCookieSessionStorageFactory(cookieOptions);

even this fails  
//const { createCookieSessionStorageFactory } = await server.setup(config);

is there a way to get this server object

Thanks  
Prathibha

Thanks  
Prathibha

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [February 1, 2021, 10:38am UTC](https://discuss.elastic.co/t/kibana-7-10-handling-cookie-on-server-side-custom-plugin/262770/2 "2021-02-01T10:38:03Z")

</div>

Hi @Prathibha_Y ,

Can you please explain what exactly you're trying to achieve? `createCookieSessionStorageFactory` is solely used by the Kibana own Security plugin right now, so you may need to use another approach depending on your use case.

Best,  
Oleg

---

<div class="post-metadata">

**Author:** ![Prathibha\_Y](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prathibha_y/32/95786_2.png) [@Prathibha\_Y](https://discuss.elastic.co/u/Prathibha_Y)\
**Post date:** [February 1, 2021, 11:08am UTC](https://discuss.elastic.co/t/kibana-7-10-handling-cookie-on-server-side-custom-plugin/262770/3 "2021-02-01T11:08:07Z")

</div>

Hi

I am trying to create a session cookie on server side, which will be used to compare with incoming requests, if same user, n other parameters are same then i will not do authorisation again.

Authorisation is done inside our application, based on this cookie n incoming request..

Prev in 7.0 we used hapi auth cookie, but with new platform unsure what to do.. Pls guide me with some example

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 1, 2021, 11:08am UTC](https://discuss.elastic.co/t/kibana-7-10-handling-cookie-on-server-side-custom-plugin/262770/4 "2021-03-01T11:08:46Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
