Skip to content

An easy session module, writed by python based on pymongo using for tornado.py or web.py!

Notifications You must be signed in to change notification settings

gvsurenderreddy/mongosion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#mongosion

===========================================

####https://github.com/grasses/mongosion

#####An easy session module, writed by python base on pymongo using for tornado.py or web.py!

#Installation

===========================================

###use pip

pip install mongosion

###or source

wget https://pypi.python.org/packages/source/m/mongosion/mongosion-0.1.3.tar.gz

tar -zxvf mongosion-0.1.3.tar.gz

cd mongosion-0.10/

sudo python setup.py install

#mongosion

=========================================

####mongosion give you 5 function:

get( session_id ) => get session

delete( session_id ) => remove session

save( session_id, {}) => save sesssion

exist( session_id ) => check session is existion

expired() => delete expired sessions

####data type

{'_id':'', 'time':'', 'session': {'uid':'', 'status':'', ......} } 

#####setting setting = { # mongodb setting 'host':'localhost', 'port': 27017, 'databse':'mongosion',

	#session setting
	'session_id': '',
	'sessionExpires': 24*60*60,
	'autoDeleteExpired': True, # clean expired sessions at every get 
	'secretKey':base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes),
	'session' : { 'uid':'520', 'status':'useing', 'isLogin':False } # default type of data
}

how to work

process

mongosion.get(session_id)

process

mongosion.save(session_id, {'uid':'', 'isLogin': True})

process

#Warning

=========================================

####remember install pymongo && run mongodb


#License

=========================================

####GPL

About

An easy session module, writed by python based on pymongo using for tornado.py or web.py!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages