Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dancer2 0.204002 Redis session data lost on redirect #1306

Closed
ramkisuni opened this issue Jan 22, 2017 · 1 comment
Closed

Dancer2 0.204002 Redis session data lost on redirect #1306

ramkisuni opened this issue Jan 22, 2017 · 1 comment

Comments

@ramkisuni
Copy link

Hi,
I have

  • ubuntu 16.04 LTS server
  • PERL v5.22.1
  • Dancer2 0.204002
  • Redis server v=3.0.6 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=687a2a319020fa42

When I use Memcached, session it is working fine. But when I installed Redis and setup Redis session engine in config.yml, session data is lost.

Config.yml:
engines:
session:
Redis:
cookie_name: sippat_localhost.session
cookie_duration: 86400
session_duration: 86400
redis_server:
127.0.0.1:6379

session: Redis

My redis-cli ping PONG works fine and able to see the same session ID both in the browser and redis-cli (KEYS *);

To redirect I use, redirect uri_for('/users/' . $user->id); but I keep getting back to sign-in page.

Tried understanding issue 811 but it seems older versions of Dancer2.

Being a noob to both Perl and Dancer2, hope I have not missed something important to do or report here.

@ramkisuni
Copy link
Author

ok, in my setup, though Redis serialization is given as optional, if I enable it, redirection works for me

-- In my carton cpanfile I have the following modules
requires "Sereal::Encoder";
requires "Sereal::Decoder";
requires "Dancer2::Session::Redis";
requires "Dancer2::Session::Redis::Serialization::Sereal";
-- so carton install installed these modules

my config.yml looks like
engines:
session:
Redis:
cookie_name: redis_users.session
cookie_duration: 86400
session_duration: 864000
is_secure: 0
is_http_only: 0
redis_server: 'localhost:6379'
redis_serialization:
module: "Dancer2::Session::Redis::Serialization::Sereal"
compression: "snappy"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant