Return the content of a cookie. To read a `Signed Cookie`, the `secret` must match the one used to create the cookie (see :meth:`BaseResponse.set_cookie`). If anything goes wrong (missing cookie or wrong signature), return a default value.
(self, key, default=None, secret=None)
| 1058 | return FormsDict((c.key, c.value) for c in cookies) |
| 1059 | |
| 1060 | def get_cookie(self, key, default=None, secret=None): |
| 1061 | """ Return the content of a cookie. To read a `Signed Cookie`, the |
| 1062 | `secret` must match the one used to create the cookie (see |
| 1063 | :meth:`BaseResponse.set_cookie`). If anything goes wrong (missing |
| 1064 | cookie or wrong signature), return a default value. """ |
| 1065 | value = self.cookies.get(key) |
| 1066 | if secret and value: |
| 1067 | dec = cookie_decode(value, secret) # (key, value) tuple or None |
| 1068 | return dec[1] if dec and dec[0] == key else default |
| 1069 | return value or default |
| 1070 | |
| 1071 | @DictProperty('environ', 'bottle.request.query', read_only=True) |
| 1072 | def query(self): |
nothing calls this directly
no test coverage detected