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

  • Home
  • SEARCH
  • 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 5968731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:07:53+00:00 2026-05-22T20:07:53+00:00

I am creating a webapp on facebook that allows users to provide login details

  • 0

I am creating a webapp on facebook that allows users to provide login details for a third party website and make requests via my app to that service. (i.e. they have an account with my app, and an account with the 3rd party website.)

There is no API for this third party website, so I am using URLlib to perform the logins. Furthermore, all interactions with this 3rd party app are via a Celery Queue, so there is no link between the frontend of my app, and the actual request from my app to the 3rd party

I am trying to come up with the best way to deal with managing the cookies returned by the third party website so that I don’t have to log the user in at every action.

Would it be madness to create a table that maps users to cookies and serialise the cookies into the database?

  • 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-22T20:07:54+00:00Added an answer on May 22, 2026 at 8:07 pm

    For anyone who happens across this in the future, I was able to save the cookies in the database by using cookielib (a part of urllib) and creating my own cookiejar that dumps and loads cookies as strings that can be saved in a DB:

    class StringCookieJar(cookielib.CookieJar):
        def __init__(self, cookie_string="", policy=None):
            cookielib.CookieJar.__init__(self, policy)
                if cookie_string:
                    self._cookies = pickle.loads(cookie_string)
        def dump(self):
                return pickle.dumps(self._cookies)
    

    When creating an instance of my connection object, I set up the urllib opener with my custom cookielib:

    self.cookiejar = StringCookieJar(cookie_string=str(self.account.cookies))
    self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookiejar))
    

    where self.account.cookies is the field in the database I am using to store my cookie string:

    cookies = models.CharField(max_length=2000, blank=True)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been busy in my project creating a webapp (in struts) that manages
I'm creating a webapp to be used by iOS users, but some phone numbers
I'm planning a webapp that will allow users to create resources without signing in.
I'm building a web app that will make heavy use of Facebook connect. I'm
I am creating a webapp that relies on following a status timeline from twitter
So my intention is to have a login in my iOS app that allows
I am creating a Java web app that is meant for use by Facebook
I'm creating a simple proof-of-concept web-app that integrates with Facebook. The base functionality is
I am creating an iPhone webapp with a textbox. I would like that textbox
I have a webapp that uses login/logouts so I have session management. Basically every

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.