I need a little direction.  I used to write PHP applications and I
usually used my own cookie storage mechanism I created years ago.

Now I am using amazon to build a large scalable web system.  I have
about 30,000 users at once at times.  For free events it can reach
several 100,000 simultaneous visitors.  Every single request wants to
lookup session data in a database even though the data returned is
most often servers from memcache.

What I'm want is a simple session cookie based storage system where
the data is stored like this...

session_dictionary = {...a:b, etc ...}
data = session_dictionary -> string
setcookie( data + ":" + hash( data + server_secret ) )

Then all data is stored in the cookie and when I don't have to worry
about coordinating memcache and database access across 10 servers.
Each request contains all the data and it's validated by computing the
md5 checksum at the end matches the data string plus a secret string
only the severs know.

When I decode the cookie it only takes a bit of processor time - no
database trip unless some real action is taking place.

Decode looks like this:
cookiedata = get_cookie(xyz)
data = cookiedata[:-hash_size]
authhash = cookiedata[-hash_size:]
if hash( data + secret ) == authhash:
    # hooray - store the session data as valid

I've implemented this before in PHP but I really like web.py.  What I
would really like is to find out that someone else has already done
it.   :o)

It seems obvious to me but most session middleware I see seems to
think losing session data is a sin.  If session cookie gets lost and
people have to login again I don't mind.  I'm more concerned about
keeping my servers simple.  Right now if the changes fail to propagate
out to the other servers before some event causes the user to change
servers they have to login again anyway so the end result is the same.


Does a cookie based session storage system exist for web.py?

It somehow FEELS like it should be there but I'm not seeing it.


Thanks,

Russ Ryba


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to