# Proper place to initialize session

**URL:** <https://discourse.slimframework.com/t/proper-place-to-initialize-session/460>\
**Category:** Questions\
**Created:** [July 1, 2016, 2:28am UTC](https://discourse.slimframework.com/t/proper-place-to-initialize-session/460 "2016-07-01T02:28:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [July 1, 2016, 2:28am UTC](https://discourse.slimframework.com/t/proper-place-to-initialize-session/460/1 "2016-07-01T02:28:32Z")

</div>

I’d like to use sessions for one of my projects and I’m wondering where the session initialization should be performed if one were to do this properly.

Right now, I just do a session\_start() after calling the autoloader in my bootstrap.php. Is this OK or is there a better way & place to init session?

As usual, thank for any insights.

---

<div class="post-metadata">

**Author:** ![akrabat](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/akrabat/32/9_2.png) [@akrabat](https://discourse.slimframework.com/u/akrabat)\
**Post date:** [July 1, 2016, 7:19am UTC](https://discourse.slimframework.com/t/proper-place-to-initialize-session/460/2 "2016-07-01T07:19:31Z")

</div>

I don’t think it really matters. I’ve seen it started in index.php and in middleware.

---

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [July 1, 2016, 7:39am UTC](https://discourse.slimframework.com/t/proper-place-to-initialize-session/460/3 "2016-07-01T07:39:04Z")

</div>

That’s the answer I was hoping for 🙂
