# Configuring Plugs during runtime

**URL:** <https://forum.elixirforum.com/t/configuring-plugs-during-runtime/7359>\
**Category:** Questions\
**Tags:** plug, how-to-question\
**Created:** [July 31, 2017, 9:00am UTC](https://forum.elixirforum.com/t/configuring-plugs-during-runtime/7359 "2017-07-31T09:00:38Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![LostKobrakai](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lostkobrakai/32/3072_2.png) [@LostKobrakai](https://forum.elixirforum.com/u/LostKobrakai)\
**Post date:** [August 12, 2018, 12:58pm UTC](https://forum.elixirforum.com/t/configuring-plugs-during-runtime/7359/9 "2018-08-12T12:58:43Z")

</div>

See this post:

> [@Session cookie domain option](https://forum.elixirforum.com/t/session-cookie-domain-option/8157/4):
>
> And another one from @chrismccord himself: you could make a plug that calls the Plug.Session init, at runtime plug MySession, ... defmodule MySession do def init(opts), do: Plug.Sesson.init(opts) def call(conn, opts) do runtime\_opts = Keyword.put(opts, :domain, ...) Plug.Session.call(conn, runtime\_opts) end end in this case, I kept init at compiletime, but modified the options before calling the session plug, to do as much work as possible at compile time but you get the idea?…

---

_[View the full topic](https://forum.elixirforum.com/t/configuring-plugs-during-runtime/7359)._
