MCPcopy Create free account
hub / github.com/webpy/webpy / _setcookie

Method _setcookie

web/session.py:154–170  ·  view source on GitHub ↗
(self, session_id, expires="", **kw)

Source from the content-addressed store, hash-verified

152 self._setcookie(self.session_id, expires=-1)
153
154 def _setcookie(self, session_id, expires="", **kw):
155 cookie_name = self._config.cookie_name
156 cookie_domain = self._config.cookie_domain
157 cookie_path = self._config.cookie_path
158 httponly = self._config.httponly
159 secure = self._config.secure
160 samesite = kw.get("samesite", self._config.get("samesite", None))
161 web.setcookie(
162 cookie_name,
163 session_id,
164 expires=expires,
165 domain=cookie_domain,
166 httponly=httponly,
167 secure=secure,
168 path=cookie_path,
169 samesite=samesite,
170 )
171
172 def _generate_session_id(self):
173 """Generate a random id for session"""

Callers 1

_saveMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected