The Slim Framework support forum has moved to http://discourse.slimframework.com. 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?

Thanks
Scott

Showing page 3 out of 3. View the first page

  1. 60 Posted by zirufuko on 27 Sep, 2017 02:16 AM

    zirufuko's Avatar

    These cooks will help you in making today's dinner.
    http://www.the3weekdietsystem.com/

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

    zirufuko's Avatar

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

Generic

? 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