I am using OpenID as a login system for a google appengine website and I right now for every website I am just passing the user info to every page using user = users.get_current_user()
Would using a cookie to do this be more efficient? (I know if would be easier that putting that in every single webpage) and is these any special way to do it with google appengine? I already have a cookie counting visits but I would image it’ll be a little different.
Update: Could I do self.user = users.get_current_user() as a global variable and then pass in user=self.user on every page to have access to that variable?
Thanks!
users.get_current_user()is actually reading the cookies so you don’t need to do anything more to optimize it (you can easily verify it by deleting your cookies and then refreshing the page). Unless you want to store more information and have access to them without accessing the datastore on every request.