Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6667061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:53:37+00:00 2026-05-26T02:53:37+00:00

I have a Pyramid application using Beaker Encrypted cookie sessions. I can log a

  • 0

I have a Pyramid application using Beaker Encrypted cookie sessions. I can log a user in using a RequestWithUserAttribute, pyramid.security.authenticated_userid(), remember() and forget() just fine.

However, the majority of users will never log in, and there is a specific value I’d like to save in a cookie (encrypted if at all possible) that the user has given then site (their location, or any string for that matter).

I cannot discover how to set more than the principal for a session using the remember() function, and I’d prefer not to send my own Set-Cookie headers, let alone deal with the encryption of the data myself.

I have found that you can pass keyword arguments to remember():

remember(request, principal, *kw)

But when I try to send any extra values I continuously run into an error.

Ideally I would expect something like this:

remember(request, 'public', {'location':request.params.get('location')})

Is this even the correct route?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:53:38+00:00Added an answer on May 26, 2026 at 2:53 am

    Sessions and Authentication in Pyramid (and in general) are disjoint concepts. There are a lot of people who learn the way to store the authenticated user “is in a session”, but in no way is this a requirement. The point of a session is to store arbitrary data for a visitor to your site across requests. That could be the fact that they are logged in or it could be your random strings.

    The point is you can store random stuff in the session. It is available in Pyramid (after you’ve setup the session_factory on the Configurator) directly on the request object via request.session.

    request.session['mykey'] = 'some random value'
    

    This does not require you to use authentication, remember/forget, or anything other than a session factory.

    https://docs.pylonsproject.org/projects/pyramid/en/1.2-branch/narr/sessions.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using pyramid to create a web application. I am then using pyramid-beaker
I am working on a pyramid web application that uses SQLAlchemy. I have a
I have a pyramid project using the formalchemy admin interface. I added the basic
I have deployed a Pyramid app using mod_wsgi. I have setup the python path
I'm trying to build an application using the new-ish Pyramid framework . I'm new
I am serving quite large files from a Pyramid Application I have written. My
Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
Have a n-tire web application and search often times out after 30 secs. How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.