in reply to Session being destroyed

From the outside, it's very hard to diagnose your problem, as you don't show any code and don't tell us what framework and environment you are using.

Can you reduce your code to a short, self-contained example that reproduces the problem? I would assume that basically creating a fake session and then the codew to serve the thumbnail and image information should be sufficient to reproduce the problem.

Are you certain that the problem is on your end? Maybe the browser(s) don't send the session cookies? Have you used wget or LWP::UserAgent to verify that the correct headers are sent and received?

Replies are listed 'Best First'.
Re^2: Session being destroyed
by FZ (Initiate) on Jun 27, 2018 at 05:34 UTC
    We are using Perl 5 (v5.16.3) Dancer2 (0.206000) on CentOS 7.

    URL for getting images is like:
    GET http://xyz.site/library/assets/354/versions/1/thumb?proxy=300.jpg&counter=0

    There is only request cookie in case it works. Which is something like:

    Request cookies:
    dancer.session WzFwlwAAbcptBdxFGkBSF1u6KnoEbIF0

    For fail case there is also a response cookie and it is different:

    Request cookies:
    dancer.session WzFwlwAAbcptBdxFGkBSF1u6KnoEbIF0

    Response cookies:
    dancer.session
    httpOnly true
    path /
    value WzFw_gAAbcrid2OMH0ZSxymggqHS6DKq

    I have also verified that a new physical dancer session file (empty) is created as soon as session is destroyed.

      So it seems that somewhere in your code, a new session gets created. Without seeing your code, it's hard to guess where that could be.

      Dancer2::Session doesn't list any immediate method to invalidate a session, so something else must be going on in your code. Maybe you can reduce your code to the absolute minimum to reproduce the problem and show that here?