forked from orbit-oss/flask
Changed session cookie defaults to work better with google chrome
This commit is contained in:
parent
6bd0080575
commit
bfeee75696
3 changed files with 28 additions and 0 deletions
|
|
@ -190,6 +190,22 @@ class BasicFunctionalityTestCase(FlaskTestCase):
|
|||
self.assert_('domain=.example.com' in rv.headers['set-cookie'].lower())
|
||||
self.assert_('httponly' in rv.headers['set-cookie'].lower())
|
||||
|
||||
def test_session_using_server_name_port_and_path(self):
|
||||
app = flask.Flask(__name__)
|
||||
app.config.update(
|
||||
SECRET_KEY='foo',
|
||||
SERVER_NAME='example.com:8080',
|
||||
APPLICATION_ROOT='/foo'
|
||||
)
|
||||
@app.route('/')
|
||||
def index():
|
||||
flask.session['testing'] = 42
|
||||
return 'Hello World'
|
||||
rv = app.test_client().get('/', 'http://example.com:8080/foo')
|
||||
self.assert_('domain=example.com' in rv.headers['set-cookie'].lower())
|
||||
self.assert_('path=/foo' in rv.headers['set-cookie'].lower())
|
||||
self.assert_('httponly' in rv.headers['set-cookie'].lower())
|
||||
|
||||
def test_session_using_application_root(self):
|
||||
class PrefixPathMiddleware(object):
|
||||
def __init__(self, app, prefix):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue