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 6338511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:27:33+00:00 2026-05-24T19:27:33+00:00

I’m trying to mimic the login page from the example http://tipfy-auth.appspot.com (source http://code.google.com/p/tipfy/source/browse/examples/auth/app/ )

  • 0

I’m trying to mimic the login page from the example http://tipfy-auth.appspot.com (source http://code.google.com/p/tipfy/source/browse/examples/auth/app/) without success. I seem to run in to problem when the user is redirected back to the page. The current request flow looks like:

LoginPage (LoginHandler) -> Facebook redirect (FacebookAuthHandler) 302 -> Facebook.com -> Facebook redirect (FacebookAuthHandler) 302 -> SignupPage (SignupHandler) 302 -> LoginPage(LoginHandler).

The problem here (as far as I figured) is the last 302(http-redirect) from signup (should be endpoint) to the loginpage again.

After some intense logging (can’t find away to test this locally) it seems that a session is set when returning from facebook. The session is stored as a dict on the request handler (FacebookAuthHandler) in two places self.auth.session(a dict) and self.session(a SecureCookieSession) but after the redirect to SignupPage the self.auth.session is None.

The redirect from SignUpPage to LoginPage occurs due to that the SignupHandler‘s get method has a decorator @login_required that looks at self.auth.session to determine if the reuquest should be handled here or be redirected.

So why aren’t the self.auth.session preserved between requests while the self.session are? Are self.auth.session set at every request? How are the sessions stored? If it’s in the db, does the datastore type matter (master/slave or high replication).

I’m digging around the source code but can’t find any thing helpful.

..fredrik

EDIT

Posted answer below.

  • 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-24T19:27:34+00:00Added an answer on May 24, 2026 at 7:27 pm

    I’ve narrowed it down to that the problem lies within session property of the SessionAuthStore class.

    When accessing the session property (this is the property @login_required looks at to determine if redirect the user or not) it runs this code (in tipfy.auth.SessionAuthStore):

    if not self.loaded:
        self._load_session_and_user()
    
    return self._session
    

    The problem here is that in the _load_session_and_user method expects to be able to a load a user from the datastore based on the ‘token’ key inside the session.

    Unfortunately there’s no user when returning from Facebook. So it will fail and redirect the user to the login page.

    To proceed in my project i changed the code a bit, the @login_required (tipfy.auth.init.py)

    if not auth.session:
            auth._load_session() # If no session try to load it from the _session_base
    
        if not auth.session:
            return handler.redirect(auth.login_url())
    

    And a new method on MultiAuthStore class.

    def _load_session(self):
            self.loaded = True
            session = self._session_base.get('_auth', {})
            if session:
                self._session = session
    

    Probably not the best solution but it works.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.