The Slim Framework support forum has moved to This Tender forum is no longer maintained or monitored.

Cookie Session in middleware

Scott Nicolson's Avatar

Scott Nicolson

13 May, 2013 08:39 PM

I am trying to set a Session value using the super global $_SESSION in a middleware but it doesn't get set and saved.

I have invoked the Slim\Midddleware\SessionCookie after my custom middleware. I am basically setting a flag $_SESSION['flag'] = true and redirecting using $this->app->redirect('/'). after the redirect he session is still empty.

I have put var_exports in my middleware and the session middleware around the calls to load and session and get the following output:

// loading session debug message
// my middleware debug message
// saving session debug message

Any ideas where i might be going wrong?


Showing page 3 out of 3. View the first page

  1. 61 Posted by zirufuko on 27 Sep, 2017 02:28 AM

    zirufuko's Avatar
  2. 62 Posted by root on 19 Oct, 2017 05:48 PM

    root's Avatar

    you serve good knowledge

  3. 63 Posted by Andserson on 15 Dec, 2017 09:49 PM

    Andserson's Avatar
  4. 64 Posted by shiloh27 on 26 Dec, 2017 01:31 AM

    shiloh27's Avatar

    I am also getting same problem and it is really wonderful.

  5. 65 Posted by felitaa9 on 29 Dec, 2017 03:41 AM

    felitaa9's Avatar

    The question is how to solve this problem? You can read more at this site

  6. 66 Posted by Elien on 05 Jan, 2018 05:25 AM

    Elien's Avatar Apps For iPad with that you can also import the file into Spotify from your PC hard drive or from your Windows Media Player Library or your iTunes library.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac