Andrew Martinez
Andrew Martinez

Reputation: 3754

How do I override the default session timeout with pyramid + pyramid-beaker + beaker

I am using pyramid to create a web application. I am then using pyramid-beaker to interface beaker into pyramid's session management system.

Two values affect the duration of a user's session.

  1. The session cookie timeout
  2. The actual session's life time on either disk/memcache/rdbms/etc

I currently have to cookie defaulted (via the standard beaker config) to delete when the browser closes. I have the session data set to clear out after 2 hours. This works prefectly.

What I need to know is how to override the cookie's timeout and the session timeout to both be 30 days or some other arbirtrary value.

Upvotes: 3

Views: 2469

Answers (2)

enomad
enomad

Reputation: 1135

I have a solution. Its old but works.

Upvotes: 1

Michael Merickel
Michael Merickel

Reputation: 23331

Changing the timeout isn't supported by beaker. If you are trying to make a session stick around that long, you should probably just put it into a separate cookie. A common use-case is the "remember me" checkbox on login. This helps you track who the user is, but generally the actual session shouldn't be sticking around that long and gets recreated.

Upvotes: 2

Related Questions