We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
webclient : cookie may contains several '=' 
Which leads to a ValueError: too many values to unpack.

A PR to correct the problem will follow

webclient : cookie may contains several '=' 
Which leads to a ValueError: too many values to unpack.

A PR to correct the problem will follow


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `gluon/contrib/webclient.py`
Content:
```
1 """
2 Developed by Massimo Di Pierro
3 Released under the web2py license (LGPL)
4 
5 It an interface on top of urllib2 which simplifies scripting of http requests
6 mostly for testing purposes
7 
8 - customizable
9 - supports basic auth
10 - supports cookies
11 - supports session cookies (tested with web2py sessions)
12 - detects broken session
13 - detects web2py form postbacks and handles formname and formkey
14 - detects web2py tickets
15 
16 Some examples at the bottom.
17 """
18 from __future__ import print_function
19 from gluon._compat import urllib2, cookielib, iteritems, to_native, urlencode, to_bytes
20 import re
21 import time
22 
23 
24 DEFAULT_HEADERS = {
25     'user-agent': 'Mozilla/4.0',  # some servers are picky
26     'accept-language': 'en',
27 }
28 
29 FORM_REGEX = re.compile('(\<input name\="_formkey" type\="hidden" value\="(?P<formkey>.+?)" \/\>)?\<input name\="_formname" type\="hidden" value\="(?P<formname>.+?)" \/\>')
30 
31 SESSION_REGEX = 'session_id_(?P<name>.+)'
32 
33 
34 class WebClient(object):
35 
36     def __init__(self,
37                  app='',
38                  postbacks=True,
39                  default_headers=DEFAULT_HEADERS,
40                  session_regex=SESSION_REGEX):
41         self.app = app
42         self.postbacks = postbacks
43         self.forms = {}
44         self.history = []
45         self.cookies = {}
46         self.default_headers = default_headers
47         self.sessions = {}
48         self.session_regex = session_regex and re.compile(session_regex)
49 
50     def get(self, url, cookies=None, headers=None, auth=None):
51         return self.post(url, data=None, cookies=cookies,
52                          headers=headers, method='GET')
53 
54     def post(self, url, data=None, cookies=None,
55              headers=None, auth=None, method='auto'):
56         self.url = self.app + url
57 
58         # if this POST form requires a postback do it
59         if data and '_formname' in data and self.postbacks and \
60                 self.history and self.history[-1][1] != self.url:
61             # to bypass the web2py CSRF need to get formkey
62             # before submitting the form
63             self.get(url, cookies=cookies, headers=headers, auth=auth)
64 
65         # unless cookies are specified, recycle cookies
66         if cookies is None:
67             cookies = self.cookies
68         cookies = cookies or {}
69         headers = headers or {}
70 
71         cj = cookielib.CookieJar()
72         args = [
73             urllib2.HTTPCookieProcessor(cj),
74             urllib2.HTTPHandler(debuglevel=0)
75             ]
76         # if required do basic auth
77         if auth:
78             auth_handler = urllib2.HTTPBasicAuthHandler()
79             auth_handler.add_password(**auth)
80             args.append(auth_handler)
81 
82         opener = urllib2.build_opener(*args)
83 
84         # copy headers from dict to list of key,value
85         headers_list = []
86         for key, value in iteritems(self.default_headers):
87             if not key in headers:
88                 headers[key] = value
89         for key, value in iteritems(headers):
90             if isinstance(value, (list, tuple)):
91                 for v in value:
92                     headers_list.append((key, v))
93             else:
94                 headers_list.append((key, value))
95 
96         # move cookies to headers
97         for key, value in iteritems(cookies):
98             headers_list.append(('Cookie', '%s=%s' % (key, value)))
99 
100         # add headers to request
101         for key, value in headers_list:
102             opener.addheaders.append((key, str(value)))
103 
104         # assume everything is ok and make http request
105         error = None
106         try:
107             if isinstance(data, str):
108                 self.method = 'POST' if method=='auto' else method
109             elif isinstance(data, dict):
110                 self.method = 'POST' if method=='auto' else method
111                 # if there is only one form, set _formname automatically
112                 if not '_formname' in data and len(self.forms) == 1:
113                     data['_formname'] = self.forms.keys()[0]
114 
115                 # if there is no formkey but it is known, set it
116                 if '_formname' in data and not '_formkey' in data and \
117                         data['_formname'] in self.forms:
118                     data['_formkey'] = self.forms[data['_formname']]
119 
120                 # time the POST request
121                 data = urlencode(data, doseq=True)
122             else:
123                 self.method = 'GET' if method=='auto' else method
124                 data = None
125             t0 = time.time()
126             self.response = opener.open(self.url, to_bytes(data))
127             self.time = time.time() - t0
128         except urllib2.HTTPError as er:
129             error = er
130             # catch HTTP errors
131             self.time = time.time() - t0
132             self.response = er
133 
134         if hasattr(self.response, 'getcode'):
135             self.status = self.response.getcode()
136         else:#python2.5
137             self.status = None
138 
139         self.text = to_native(self.response.read())
140         # In PY3 self.response.headers are case sensitive
141         self.headers = dict()
142         for h in self.response.headers:
143             self.headers[h.lower()] = self.response.headers[h]
144 
145         # treat web2py tickets as special types of errors
146         if error is not None:
147             if 'web2py_error' in self.headers:
148                 raise RuntimeError(self.headers['web2py_error'])
149             else:
150                 raise error
151 
152         # parse headers into cookies
153         self.cookies = {}
154         if 'set-cookie' in self.headers:
155             for item in self.headers['set-cookie'].split(','):
156                 key, value = item[:item.find(';')].split('=')
157                 self.cookies[key.strip()] = value.strip()
158 
159         # check is a new session id has been issued, symptom of broken session
160         if self.session_regex is not None:
161             for cookie, value in iteritems(self.cookies):
162                 match = self.session_regex.match(cookie)
163                 if match:
164                     name = match.group('name')
165                     if name in self.sessions and self.sessions[name] != value:
166                         print(RuntimeError('Changed session ID %s' % name))
167                     self.sessions[name] = value
168 
169         # find all forms and formkeys in page
170         self.forms = {}
171         for match in FORM_REGEX.finditer(to_native(self.text)):
172             self.forms[match.group('formname')] = match.group('formkey')
173 
174         # log this request
175         self.history.append((self.method, self.url, self.status, self.time))
176 
177 
178 def test_web2py_registration_and_login():
179     # from gluon.contrib.webclient import WebClient
180     # start a web2py instance for testing
181 
182     client = WebClient('http://127.0.0.1:8000/welcome/default/')
183     client.get('index')
184 
185     # register
186     data = dict(first_name='Homer',
187                 last_name='Simpson',
188                 email='homer@web2py.com',
189                 password='test',
190                 password_two='test',
191                 _formname='register')
192     client.post('user/register', data=data)
193 
194     # logout
195     client.get('user/logout')
196 
197     # login
198     data = dict(email='homer@web2py.com',
199                 password='test',
200                 _formname='login')
201     client.post('user/login', data=data)
202 
203     # check registration and login were successful
204     client.get('user/profile')
205     assert 'Welcome Homer' in client.text
206 
207     # print some variables
208     print('\nsessions:\n', client.sessions)
209     print('\nheaders:\n', client.headers)
210     print('\ncookies:\n', client.cookies)
211     print('\nforms:\n', client.forms)
212     print()
213     for method, url, status, t in client.history:
214         print(method, url, status, t)
215 
216 if __name__ == '__main__':
217     test_web2py_registration_and_login()
218
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/gluon/contrib/webclient.py b/gluon/contrib/webclient.py
--- a/gluon/contrib/webclient.py
+++ b/gluon/contrib/webclient.py
@@ -46,6 +46,17 @@
         self.default_headers = default_headers
         self.sessions = {}
         self.session_regex = session_regex and re.compile(session_regex)
+        self.headers = {}
+
+    def _parse_headers_in_cookies(self):
+        self.cookies = {}
+        if 'set-cookie' in self.headers:
+            for item in self.headers['set-cookie'].split(','):
+                cookie = item[:item.find(';')]
+                pos = cookie.find('=')
+                key = cookie[:pos]
+                value = cookie[pos+1:]
+                self.cookies[key.strip()] = value.strip()
 
     def get(self, url, cookies=None, headers=None, auth=None):
         return self.post(url, data=None, cookies=cookies,
@@ -149,12 +160,7 @@
             else:
                 raise error
 
-        # parse headers into cookies
-        self.cookies = {}
-        if 'set-cookie' in self.headers:
-            for item in self.headers['set-cookie'].split(','):
-                key, value = item[:item.find(';')].split('=')
-                self.cookies[key.strip()] = value.strip()
+        self._parse_headers_in_cookies()
 
         # check is a new session id has been issued, symptom of broken session
         if self.session_regex is not None:

{"golden_diff": "diff --git a/gluon/contrib/webclient.py b/gluon/contrib/webclient.py\n--- a/gluon/contrib/webclient.py\n+++ b/gluon/contrib/webclient.py\n@@ -46,6 +46,17 @@\n         self.default_headers = default_headers\n         self.sessions = {}\n         self.session_regex = session_regex and re.compile(session_regex)\n+        self.headers = {}\n+\n+    def _parse_headers_in_cookies(self):\n+        self.cookies = {}\n+        if 'set-cookie' in self.headers:\n+            for item in self.headers['set-cookie'].split(','):\n+                cookie = item[:item.find(';')]\n+                pos = cookie.find('=')\n+                key = cookie[:pos]\n+                value = cookie[pos+1:]\n+                self.cookies[key.strip()] = value.strip()\n \n     def get(self, url, cookies=None, headers=None, auth=None):\n         return self.post(url, data=None, cookies=cookies,\n@@ -149,12 +160,7 @@\n             else:\n                 raise error\n \n-        # parse headers into cookies\n-        self.cookies = {}\n-        if 'set-cookie' in self.headers:\n-            for item in self.headers['set-cookie'].split(','):\n-                key, value = item[:item.find(';')].split('=')\n-                self.cookies[key.strip()] = value.strip()\n+        self._parse_headers_in_cookies()\n \n         # check is a new session id has been issued, symptom of broken session\n         if self.session_regex is not None:\n", "issue": "webclient : cookie may contains several '=' \nWhich leads to a ValueError: too many values to unpack.\n\nA PR to correct the problem will follow\n\nwebclient : cookie may contains several '=' \nWhich leads to a ValueError: too many values to unpack.\n\nA PR to correct the problem will follow\n\n", "before_files": [{"content": "\"\"\"\nDeveloped by Massimo Di Pierro\nReleased under the web2py license (LGPL)\n\nIt an interface on top of urllib2 which simplifies scripting of http requests\nmostly for testing purposes\n\n- customizable\n- supports basic auth\n- supports cookies\n- supports session cookies (tested with web2py sessions)\n- detects broken session\n- detects web2py form postbacks and handles formname and formkey\n- detects web2py tickets\n\nSome examples at the bottom.\n\"\"\"\nfrom __future__ import print_function\nfrom gluon._compat import urllib2, cookielib, iteritems, to_native, urlencode, to_bytes\nimport re\nimport time\n\n\nDEFAULT_HEADERS = {\n    'user-agent': 'Mozilla/4.0',  # some servers are picky\n    'accept-language': 'en',\n}\n\nFORM_REGEX = re.compile('(\\<input name\\=\"_formkey\" type\\=\"hidden\" value\\=\"(?P<formkey>.+?)\" \\/\\>)?\\<input name\\=\"_formname\" type\\=\"hidden\" value\\=\"(?P<formname>.+?)\" \\/\\>')\n\nSESSION_REGEX = 'session_id_(?P<name>.+)'\n\n\nclass WebClient(object):\n\n    def __init__(self,\n                 app='',\n                 postbacks=True,\n                 default_headers=DEFAULT_HEADERS,\n                 session_regex=SESSION_REGEX):\n        self.app = app\n        self.postbacks = postbacks\n        self.forms = {}\n        self.history = []\n        self.cookies = {}\n        self.default_headers = default_headers\n        self.sessions = {}\n        self.session_regex = session_regex and re.compile(session_regex)\n\n    def get(self, url, cookies=None, headers=None, auth=None):\n        return self.post(url, data=None, cookies=cookies,\n                         headers=headers, method='GET')\n\n    def post(self, url, data=None, cookies=None,\n             headers=None, auth=None, method='auto'):\n        self.url = self.app + url\n\n        # if this POST form requires a postback do it\n        if data and '_formname' in data and self.postbacks and \\\n                self.history and self.history[-1][1] != self.url:\n            # to bypass the web2py CSRF need to get formkey\n            # before submitting the form\n            self.get(url, cookies=cookies, headers=headers, auth=auth)\n\n        # unless cookies are specified, recycle cookies\n        if cookies is None:\n            cookies = self.cookies\n        cookies = cookies or {}\n        headers = headers or {}\n\n        cj = cookielib.CookieJar()\n        args = [\n            urllib2.HTTPCookieProcessor(cj),\n            urllib2.HTTPHandler(debuglevel=0)\n            ]\n        # if required do basic auth\n        if auth:\n            auth_handler = urllib2.HTTPBasicAuthHandler()\n            auth_handler.add_password(**auth)\n            args.append(auth_handler)\n\n        opener = urllib2.build_opener(*args)\n\n        # copy headers from dict to list of key,value\n        headers_list = []\n        for key, value in iteritems(self.default_headers):\n            if not key in headers:\n                headers[key] = value\n        for key, value in iteritems(headers):\n            if isinstance(value, (list, tuple)):\n                for v in value:\n                    headers_list.append((key, v))\n            else:\n                headers_list.append((key, value))\n\n        # move cookies to headers\n        for key, value in iteritems(cookies):\n            headers_list.append(('Cookie', '%s=%s' % (key, value)))\n\n        # add headers to request\n        for key, value in headers_list:\n            opener.addheaders.append((key, str(value)))\n\n        # assume everything is ok and make http request\n        error = None\n        try:\n            if isinstance(data, str):\n                self.method = 'POST' if method=='auto' else method\n            elif isinstance(data, dict):\n                self.method = 'POST' if method=='auto' else method\n                # if there is only one form, set _formname automatically\n                if not '_formname' in data and len(self.forms) == 1:\n                    data['_formname'] = self.forms.keys()[0]\n\n                # if there is no formkey but it is known, set it\n                if '_formname' in data and not '_formkey' in data and \\\n                        data['_formname'] in self.forms:\n                    data['_formkey'] = self.forms[data['_formname']]\n\n                # time the POST request\n                data = urlencode(data, doseq=True)\n            else:\n                self.method = 'GET' if method=='auto' else method\n                data = None\n            t0 = time.time()\n            self.response = opener.open(self.url, to_bytes(data))\n            self.time = time.time() - t0\n        except urllib2.HTTPError as er:\n            error = er\n            # catch HTTP errors\n            self.time = time.time() - t0\n            self.response = er\n\n        if hasattr(self.response, 'getcode'):\n            self.status = self.response.getcode()\n        else:#python2.5\n            self.status = None\n\n        self.text = to_native(self.response.read())\n        # In PY3 self.response.headers are case sensitive\n        self.headers = dict()\n        for h in self.response.headers:\n            self.headers[h.lower()] = self.response.headers[h]\n\n        # treat web2py tickets as special types of errors\n        if error is not None:\n            if 'web2py_error' in self.headers:\n                raise RuntimeError(self.headers['web2py_error'])\n            else:\n                raise error\n\n        # parse headers into cookies\n        self.cookies = {}\n        if 'set-cookie' in self.headers:\n            for item in self.headers['set-cookie'].split(','):\n                key, value = item[:item.find(';')].split('=')\n                self.cookies[key.strip()] = value.strip()\n\n        # check is a new session id has been issued, symptom of broken session\n        if self.session_regex is not None:\n            for cookie, value in iteritems(self.cookies):\n                match = self.session_regex.match(cookie)\n                if match:\n                    name = match.group('name')\n                    if name in self.sessions and self.sessions[name] != value:\n                        print(RuntimeError('Changed session ID %s' % name))\n                    self.sessions[name] = value\n\n        # find all forms and formkeys in page\n        self.forms = {}\n        for match in FORM_REGEX.finditer(to_native(self.text)):\n            self.forms[match.group('formname')] = match.group('formkey')\n\n        # log this request\n        self.history.append((self.method, self.url, self.status, self.time))\n\n\ndef test_web2py_registration_and_login():\n    # from gluon.contrib.webclient import WebClient\n    # start a web2py instance for testing\n\n    client = WebClient('http://127.0.0.1:8000/welcome/default/')\n    client.get('index')\n\n    # register\n    data = dict(first_name='Homer',\n                last_name='Simpson',\n                email='homer@web2py.com',\n                password='test',\n                password_two='test',\n                _formname='register')\n    client.post('user/register', data=data)\n\n    # logout\n    client.get('user/logout')\n\n    # login\n    data = dict(email='homer@web2py.com',\n                password='test',\n                _formname='login')\n    client.post('user/login', data=data)\n\n    # check registration and login were successful\n    client.get('user/profile')\n    assert 'Welcome Homer' in client.text\n\n    # print some variables\n    print('\\nsessions:\\n', client.sessions)\n    print('\\nheaders:\\n', client.headers)\n    print('\\ncookies:\\n', client.cookies)\n    print('\\nforms:\\n', client.forms)\n    print()\n    for method, url, status, t in client.history:\n        print(method, url, status, t)\n\nif __name__ == '__main__':\n    test_web2py_registration_and_login()\n", "path": "gluon/contrib/webclient.py"}], "after_files": [{"content": "\"\"\"\nDeveloped by Massimo Di Pierro\nReleased under the web2py license (LGPL)\n\nIt an interface on top of urllib2 which simplifies scripting of http requests\nmostly for testing purposes\n\n- customizable\n- supports basic auth\n- supports cookies\n- supports session cookies (tested with web2py sessions)\n- detects broken session\n- detects web2py form postbacks and handles formname and formkey\n- detects web2py tickets\n\nSome examples at the bottom.\n\"\"\"\nfrom __future__ import print_function\nfrom gluon._compat import urllib2, cookielib, iteritems, to_native, urlencode, to_bytes\nimport re\nimport time\n\n\nDEFAULT_HEADERS = {\n    'user-agent': 'Mozilla/4.0',  # some servers are picky\n    'accept-language': 'en',\n}\n\nFORM_REGEX = re.compile('(\\<input name\\=\"_formkey\" type\\=\"hidden\" value\\=\"(?P<formkey>.+?)\" \\/\\>)?\\<input name\\=\"_formname\" type\\=\"hidden\" value\\=\"(?P<formname>.+?)\" \\/\\>')\n\nSESSION_REGEX = 'session_id_(?P<name>.+)'\n\n\nclass WebClient(object):\n\n    def __init__(self,\n                 app='',\n                 postbacks=True,\n                 default_headers=DEFAULT_HEADERS,\n                 session_regex=SESSION_REGEX):\n        self.app = app\n        self.postbacks = postbacks\n        self.forms = {}\n        self.history = []\n        self.cookies = {}\n        self.default_headers = default_headers\n        self.sessions = {}\n        self.session_regex = session_regex and re.compile(session_regex)\n        self.headers = {}\n\n    def _parse_headers_in_cookies(self):\n        self.cookies = {}\n        if 'set-cookie' in self.headers:\n            for item in self.headers['set-cookie'].split(','):\n                cookie = item[:item.find(';')]\n                pos = cookie.find('=')\n                key = cookie[:pos]\n                value = cookie[pos+1:]\n                self.cookies[key.strip()] = value.strip()\n\n    def get(self, url, cookies=None, headers=None, auth=None):\n        return self.post(url, data=None, cookies=cookies,\n                         headers=headers, method='GET')\n\n    def post(self, url, data=None, cookies=None,\n             headers=None, auth=None, method='auto'):\n        self.url = self.app + url\n\n        # if this POST form requires a postback do it\n        if data and '_formname' in data and self.postbacks and \\\n                self.history and self.history[-1][1] != self.url:\n            # to bypass the web2py CSRF need to get formkey\n            # before submitting the form\n            self.get(url, cookies=cookies, headers=headers, auth=auth)\n\n        # unless cookies are specified, recycle cookies\n        if cookies is None:\n            cookies = self.cookies\n        cookies = cookies or {}\n        headers = headers or {}\n\n        cj = cookielib.CookieJar()\n        args = [\n            urllib2.HTTPCookieProcessor(cj),\n            urllib2.HTTPHandler(debuglevel=0)\n            ]\n        # if required do basic auth\n        if auth:\n            auth_handler = urllib2.HTTPBasicAuthHandler()\n            auth_handler.add_password(**auth)\n            args.append(auth_handler)\n\n        opener = urllib2.build_opener(*args)\n\n        # copy headers from dict to list of key,value\n        headers_list = []\n        for key, value in iteritems(self.default_headers):\n            if not key in headers:\n                headers[key] = value\n        for key, value in iteritems(headers):\n            if isinstance(value, (list, tuple)):\n                for v in value:\n                    headers_list.append((key, v))\n            else:\n                headers_list.append((key, value))\n\n        # move cookies to headers\n        for key, value in iteritems(cookies):\n            headers_list.append(('Cookie', '%s=%s' % (key, value)))\n\n        # add headers to request\n        for key, value in headers_list:\n            opener.addheaders.append((key, str(value)))\n\n        # assume everything is ok and make http request\n        error = None\n        try:\n            if isinstance(data, str):\n                self.method = 'POST' if method=='auto' else method\n            elif isinstance(data, dict):\n                self.method = 'POST' if method=='auto' else method\n                # if there is only one form, set _formname automatically\n                if not '_formname' in data and len(self.forms) == 1:\n                    data['_formname'] = self.forms.keys()[0]\n\n                # if there is no formkey but it is known, set it\n                if '_formname' in data and not '_formkey' in data and \\\n                        data['_formname'] in self.forms:\n                    data['_formkey'] = self.forms[data['_formname']]\n\n                # time the POST request\n                data = urlencode(data, doseq=True)\n            else:\n                self.method = 'GET' if method=='auto' else method\n                data = None\n            t0 = time.time()\n            self.response = opener.open(self.url, to_bytes(data))\n            self.time = time.time() - t0\n        except urllib2.HTTPError as er:\n            error = er\n            # catch HTTP errors\n            self.time = time.time() - t0\n            self.response = er\n\n        if hasattr(self.response, 'getcode'):\n            self.status = self.response.getcode()\n        else:#python2.5\n            self.status = None\n\n        self.text = to_native(self.response.read())\n        # In PY3 self.response.headers are case sensitive\n        self.headers = dict()\n        for h in self.response.headers:\n            self.headers[h.lower()] = self.response.headers[h]\n\n        # treat web2py tickets as special types of errors\n        if error is not None:\n            if 'web2py_error' in self.headers:\n                raise RuntimeError(self.headers['web2py_error'])\n            else:\n                raise error\n\n        self._parse_headers_in_cookies()\n\n        # check is a new session id has been issued, symptom of broken session\n        if self.session_regex is not None:\n            for cookie, value in iteritems(self.cookies):\n                match = self.session_regex.match(cookie)\n                if match:\n                    name = match.group('name')\n                    if name in self.sessions and self.sessions[name] != value:\n                        print(RuntimeError('Changed session ID %s' % name))\n                    self.sessions[name] = value\n\n        # find all forms and formkeys in page\n        self.forms = {}\n        for match in FORM_REGEX.finditer(to_native(self.text)):\n            self.forms[match.group('formname')] = match.group('formkey')\n\n        # log this request\n        self.history.append((self.method, self.url, self.status, self.time))\n\n\ndef test_web2py_registration_and_login():\n    # from gluon.contrib.webclient import WebClient\n    # start a web2py instance for testing\n\n    client = WebClient('http://127.0.0.1:8000/welcome/default/')\n    client.get('index')\n\n    # register\n    data = dict(first_name='Homer',\n                last_name='Simpson',\n                email='homer@web2py.com',\n                password='test',\n                password_two='test',\n                _formname='register')\n    client.post('user/register', data=data)\n\n    # logout\n    client.get('user/logout')\n\n    # login\n    data = dict(email='homer@web2py.com',\n                password='test',\n                _formname='login')\n    client.post('user/login', data=data)\n\n    # check registration and login were successful\n    client.get('user/profile')\n    assert 'Welcome Homer' in client.text\n\n    # print some variables\n    print('\\nsessions:\\n', client.sessions)\n    print('\\nheaders:\\n', client.headers)\n    print('\\ncookies:\\n', client.cookies)\n    print('\\nforms:\\n', client.forms)\n    print()\n    for method, url, status, t in client.history:\n        print(method, url, status, t)\n\nif __name__ == '__main__':\n    test_web2py_registration_and_login()\n", "path": "gluon/contrib/webclient.py"}]}