incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sasha Dolgy <sdo...@gmail.com>
Subject Re: cassandra as session store
Date Mon, 14 Feb 2011 18:32:20 GMT
hi,

a few weeks back this topic had some discussion (cassandra as a session
store).  subsequently, i threw together a quick hack to have PHP use
Cassandra as a session store.  A benefit I quickly found is that I could
rely on Cassandra to expire the sessions and not PHP session garbage
collection.  nice.

The code is at the following URL and uses phpcassa as the interface to
thrift.

http://pastebin.com/pKEKhCgg

Sessions were given their own column family, with the row key defined as the
site name.  each column is a session id with the column data being the
session data.

Works a treat.  Each time PHP session_start() is called, the expiry on the
column resets back to the original value.  So, if the expiry is set to 1
hour, it's 1 hour after the last session_start() was invoked.

-sd
<http://pastebin.com/pKEKhCgg>

-- 
Sasha Dolgy
sasha.dolgy@gmail.com

Mime
View raw message