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 2 out of 2. View the first page

  1. 31 Posted by nokubako on 18 Oct, 2016 01:54 AM

    nokubako's Avatar

    I really love this information and I really love to find about it. Free Hybeam Flashlight by Survival Life

  2. 32 Posted by freecre1stbc on 19 Oct, 2016 01:10 AM

    freecre1stbc's Avatar

    Thanks for highlighting this. My problem is solve now. Survival Life's Credit Card Knife Free

  3. 33 Posted by jarxr on 25 Nov, 2016 01:45 AM

    jarxr's Avatar

    You are right. There is lot of problems in cookie session in middleware. Benefits From Lean Belly Breakthrough

  4. 34 Posted by vqwxr on 26 Nov, 2016 01:19 AM

    vqwxr's Avatar

    This problem is keep on occurring again and again and I don't know what to do. The Half Day Diet By Nate Miyaki

  5. 35 Posted by kibaru on 16 Dec, 2016 06:53 AM

    kibaru's Avatar
  6. 36 Posted by tim on 16 Dec, 2016 06:54 AM

    tim's Avatar

    awesome site. Keep rocking
    https://www.tellmeajokes.com/

  7. 37 Posted by sivok on 18 Jan, 2017 10:42 AM

    sivok's Avatar
  8. 38 Posted by hjgyuhfvh on 24 Jan, 2017 12:50 PM

    hjgyuhfvh's Avatar
  9. 39 Posted by fcgvhbjn on 03 Feb, 2017 05:07 AM

    fcgvhbjn's Avatar
  10. 40 Posted by fcgvhbjn on 03 Feb, 2017 06:54 AM

    fcgvhbjn's Avatar
  11. 41 Posted by fcgvhbjn on 03 Feb, 2017 10:20 AM

    fcgvhbjn's Avatar
  12. 42 Posted by Asok on 04 Feb, 2017 04:59 AM

    Asok's Avatar
  13. 43 Posted by Asok on 04 Feb, 2017 05:17 AM

    Asok's Avatar
  14. 44 Posted by ankok on 06 Feb, 2017 05:19 AM

    ankok's Avatar
  15. 45 Posted by ankok on 06 Feb, 2017 06:24 AM

    ankok's Avatar
  16. 46 Posted by ankok on 06 Feb, 2017 10:14 AM

    ankok's Avatar
  17. 47 Posted by dfgn on 07 Feb, 2017 05:55 AM

    dfgn's Avatar
  18. 48 Posted by dfgn on 07 Feb, 2017 10:22 AM

    dfgn's Avatar
  19. 49 Posted by dfgn on 08 Feb, 2017 05:09 AM

    dfgn's Avatar
  20. 50 Posted by dfgn on 08 Feb, 2017 09:48 AM

    dfgn's Avatar
  21. 51 Posted by guliwuru on 02 May, 2017 02:43 AM

    guliwuru's Avatar

    First clear your browser cookie to see this video.
    http://winexbackfast.com/

  22. 52 Posted by pitozova on 03 May, 2017 01:04 AM

    pitozova's Avatar

    I will tell you how to clear your cookies.
    http://manifestationreview.com/

  23. 53 Posted by karth on 27 May, 2017 02:02 PM

    karth's Avatar

    it sounds interesting. i would highly recommented you guys to see this <a href=”http://www.jobscorners.com/”>jobs for freshers</a>

  24. 54 Posted by suresh on 29 May, 2017 06:46 AM

    suresh's Avatar

    it sounds interesting..
    i would highly recommended you guys to see this
    <a href=”http://www.cautionpls.com/”>food for hair growth and thickness</a>

  25. 55 Posted by pxts on 05 Jun, 2017 01:21 AM

    pxts's Avatar

    I was also having same problem but thankfully I solved it without any professional help.
    [EZ Battery Reconditioning Review - Reviewshut](http://www.reviewshut.com/ez-battery-reconditioning-review/)

  26. 56 Posted by chws on 08 Jun, 2017 02:02 AM

    chws's Avatar

    I love this cookie session because it is so nicely created. 3 Step Stamina free download

  27. 57 Posted by goot on 08 Jul, 2017 07:56 AM

    goot's Avatar
  28. 58 Posted by davidcruise on 29 Aug, 2017 07:55 AM

    davidcruise'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