# Spawner life cycle

**URL:** <https://discourse.jupyter.org/t/spawner-life-cycle/7186>\
**Category:** JupyterHub\
**Tags:** jupyterhub\
**Created:** [December 16, 2020, 8:01pm UTC](https://discourse.jupyter.org/t/spawner-life-cycle/7186 "2020-12-16T20:01:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chambon](https://avatars.discourse-cdn.com/v4/letter/c/2bfe46/32.png) [@chambon](https://discourse.jupyter.org/u/chambon)\
**Post date:** [December 16, 2020, 8:01pm UTC](https://discourse.jupyter.org/t/spawner-life-cycle/7186/1 "2020-12-16T20:01:22Z")

</div>

Hello,

Can someone explain to me the spawner life cycle ?

For pupose of a demo, I’d like to provide a `reset button`, on the spawn page (with an option form) to force the refreh of that Form  
I have started to implement a class, lets say `class ResetStuff(BaseHandler): ` + an HTML for with `action="/hub/reset_stuff"` + an extra\_handlers like

```auto
c.JupyterHub.extra_handlers = [
  (r'/reset_stuff', ResetStuff)
]

```

In the post method of `ResetStuff`, how to create a new spawner, in the same way an done after authentication ?

I have made several attempts (without success) like

```auto
   the_spawner_instance = self.current_user.spawners['']
    if the_spawner_instance:
      the_spawner_instance.stop()

```

or

```auto
   self.clear_login_cookie()

```

But I didn’t succeed . The `_options_form_default` method is not invoked as I would expect

Best regards
