Skip to content
Browse files

Merge branch 'master' of git://github.com/webpy/webpy

  • Loading branch information...
2 parents 747a560 + c2c2544 commit d33e02524754b34778f6509c771583a21b2b9520 @shuge shuge committed
Showing with 23 additions and 1 deletion.
  1. +14 −0 .travis.yml
  2. +5 −0 test/requirements.txt
  3. +4 −1 web/session.py
View
14 .travis.yml
@@ -0,0 +1,14 @@
+language: python
+python:
+ - "2.6"
+ - "2.7"
+install: pip install -r test/requirements.txt --use-mirrors
+script: python test/alltests.py
+before_install:
+ - "sudo mkdir -p /usr/include/postgresql/8.4/server"
+ - "sudo apt-get install python-profiler"
+before_script:
+ - "psql -c 'create database webpy;' -U postgres"
+ - mysql --user=root -e "create user 'scott'@'localhost' identified by 'tiger'; create database webpy; grant all privileges on webpy.* to 'scott'@'localhost' with grant option;"
+notifications:
+ irc: "irc.freenode.org#webpy"
View
5 test/requirements.txt
@@ -0,0 +1,5 @@
+psycopg2
+pysqlite
+MySQL-python
+PyGreSQL
+DBUtils
View
5 web/session.py
@@ -28,6 +28,7 @@
web.config.session_parameters = utils.storage({
'cookie_name': 'webpy_session_id',
'cookie_domain': None,
+ 'cookie_path' : None,
'timeout': 86400, #24 * 60 * 60, # 24 hours in seconds
'ignore_expiry': True,
'ignore_change_ip': True,
@@ -92,6 +93,7 @@ def _load(self):
"""Load the session from the store, by the id from cookie"""
cookie_name = self._config.cookie_name
cookie_domain = self._config.cookie_domain
+ cookie_path = self._config.cookie_path
httponly = self._config.httponly
self.session_id = web.cookies().get(cookie_name)
@@ -140,9 +142,10 @@ def _save(self):
def _setcookie(self, session_id, expires='', **kw):
cookie_name = self._config.cookie_name
cookie_domain = self._config.cookie_domain
+ cookie_path = self._config.cookie_path
httponly = self._config.httponly
secure = self._config.secure
- web.setcookie(cookie_name, session_id, expires=expires, domain=cookie_domain, httponly=httponly, secure=secure)
+ web.setcookie(cookie_name, session_id, expires=expires, domain=cookie_domain, httponly=httponly, secure=secure, path=cookie_path)
def _generate_session_id(self):
"""Generate a random id for session"""

0 comments on commit d33e025

Please sign in to comment.
Something went wrong with that request. Please try again.