paulb@1 | 1 | #!/usr/bin/env python |
paulb@1 | 2 | |
paulb@1 | 3 | """ |
paulb@1 | 4 | Twisted classes. |
paulb@403 | 5 | |
paulb@403 | 6 | Copyright (C) 2004, 2005 Paul Boddie <paul@boddie.org.uk> |
paulb@403 | 7 | |
paulb@403 | 8 | This library is free software; you can redistribute it and/or |
paulb@403 | 9 | modify it under the terms of the GNU Lesser General Public |
paulb@403 | 10 | License as published by the Free Software Foundation; either |
paulb@403 | 11 | version 2.1 of the License, or (at your option) any later version. |
paulb@403 | 12 | |
paulb@403 | 13 | This library is distributed in the hope that it will be useful, |
paulb@403 | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
paulb@403 | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
paulb@403 | 16 | Lesser General Public License for more details. |
paulb@403 | 17 | |
paulb@403 | 18 | You should have received a copy of the GNU Lesser General Public |
paulb@403 | 19 | License along with this library; if not, write to the Free Software |
paulb@403 | 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
paulb@1 | 21 | """ |
paulb@1 | 22 | |
paulb@1 | 23 | import Generic |
paulb@49 | 24 | from Helpers.Auth import UserInfo |
paulb@439 | 25 | from Helpers.Request import Cookie, decode_value, filter_fields |
paulb@167 | 26 | from Helpers.Response import ConvertingStream |
paulb@239 | 27 | from Helpers.Session import SessionStore |
paulb@71 | 28 | from cgi import parse_qs |
paulb@1 | 29 | |
paulb@1 | 30 | class Transaction(Generic.Transaction): |
paulb@1 | 31 | |
paulb@1 | 32 | """ |
paulb@1 | 33 | Twisted transaction interface. |
paulb@1 | 34 | """ |
paulb@1 | 35 | |
paulb@1 | 36 | def __init__(self, trans): |
paulb@1 | 37 | |
paulb@1 | 38 | "Initialise the transaction using the Twisted transaction 'trans'." |
paulb@1 | 39 | |
paulb@1 | 40 | self.trans = trans |
paulb@311 | 41 | self.content_type = None |
paulb@128 | 42 | self.user = None |
paulb@311 | 43 | self.path_info = None |
paulb@1 | 44 | |
paulb@239 | 45 | # Special objects retained throughout the transaction. |
paulb@239 | 46 | |
paulb@239 | 47 | self.session_store = None |
paulb@239 | 48 | |
paulb@239 | 49 | def commit(self): |
paulb@239 | 50 | |
paulb@239 | 51 | """ |
paulb@239 | 52 | A special method, synchronising the transaction with framework-specific |
paulb@239 | 53 | objects. |
paulb@239 | 54 | """ |
paulb@239 | 55 | |
paulb@239 | 56 | # Close the session store. |
paulb@239 | 57 | |
paulb@239 | 58 | if self.session_store is not None: |
paulb@239 | 59 | self.session_store.close() |
paulb@239 | 60 | |
paulb@338 | 61 | # Server-related methods. |
paulb@338 | 62 | |
paulb@338 | 63 | def get_server_name(self): |
paulb@338 | 64 | |
paulb@338 | 65 | "Returns the server name." |
paulb@338 | 66 | |
paulb@338 | 67 | return self.trans.getRequestHostname() |
paulb@338 | 68 | |
paulb@338 | 69 | def get_server_port(self): |
paulb@338 | 70 | |
paulb@338 | 71 | "Returns the server port as a string." |
paulb@338 | 72 | |
paulb@345 | 73 | return str(self.trans.getHost()[2]) |
paulb@338 | 74 | |
paulb@1 | 75 | # Request-related methods. |
paulb@1 | 76 | |
paulb@1 | 77 | def get_request_stream(self): |
paulb@1 | 78 | |
paulb@1 | 79 | """ |
paulb@186 | 80 | Returns the request stream for the transaction. |
paulb@1 | 81 | """ |
paulb@1 | 82 | |
paulb@5 | 83 | return self.trans.content |
paulb@1 | 84 | |
paulb@1 | 85 | def get_request_method(self): |
paulb@1 | 86 | |
paulb@1 | 87 | """ |
paulb@186 | 88 | Returns the request method. |
paulb@1 | 89 | """ |
paulb@1 | 90 | |
paulb@1 | 91 | return self.trans.method |
paulb@1 | 92 | |
paulb@1 | 93 | def get_headers(self): |
paulb@1 | 94 | |
paulb@1 | 95 | """ |
paulb@186 | 96 | Returns all request headers as a dictionary-like object mapping header |
paulb@186 | 97 | names to values. |
paulb@186 | 98 | |
paulb@91 | 99 | NOTE: If duplicate header names are permitted, then this interface will |
paulb@91 | 100 | NOTE: need to change. |
paulb@1 | 101 | """ |
paulb@1 | 102 | |
paulb@65 | 103 | return self.trans.received_headers |
paulb@65 | 104 | |
paulb@65 | 105 | def get_header_values(self, key): |
paulb@1 | 106 | |
paulb@65 | 107 | """ |
paulb@186 | 108 | Returns a list of all request header values associated with the given |
paulb@186 | 109 | 'key'. Note that according to RFC 2616, 'key' is treated as a |
paulb@186 | 110 | case-insensitive string. |
paulb@65 | 111 | """ |
paulb@65 | 112 | |
paulb@65 | 113 | # Twisted does not convert the header key to lower case (which is the |
paulb@65 | 114 | # stored representation). |
paulb@65 | 115 | |
paulb@65 | 116 | return self.convert_to_list(self.trans.received_headers.get(key.lower())) |
paulb@1 | 117 | |
paulb@1 | 118 | def get_content_type(self): |
paulb@1 | 119 | |
paulb@1 | 120 | """ |
paulb@186 | 121 | Returns the content type specified on the request, along with the |
paulb@186 | 122 | charset employed. |
paulb@1 | 123 | """ |
paulb@1 | 124 | |
paulb@1 | 125 | return self.parse_content_type(self.trans.getHeader("Content-Type")) |
paulb@1 | 126 | |
paulb@1 | 127 | def get_content_charsets(self): |
paulb@1 | 128 | |
paulb@1 | 129 | """ |
paulb@1 | 130 | Returns the character set preferences. |
paulb@1 | 131 | """ |
paulb@1 | 132 | |
paulb@1 | 133 | return self.parse_content_preferences(self.trans.getHeader("Accept-Language")) |
paulb@1 | 134 | |
paulb@1 | 135 | def get_content_languages(self): |
paulb@1 | 136 | |
paulb@1 | 137 | """ |
paulb@186 | 138 | Returns extracted language information from the transaction. |
paulb@1 | 139 | """ |
paulb@1 | 140 | |
paulb@1 | 141 | return self.parse_content_preferences(self.trans.getHeader("Accept-Charset")) |
paulb@1 | 142 | |
paulb@434 | 143 | def get_path(self, encoding=None): |
paulb@5 | 144 | |
paulb@5 | 145 | """ |
paulb@434 | 146 | Returns the entire path from the request as a Unicode object. Any "URL |
paulb@434 | 147 | encoded" character values in the part of the path before the query |
paulb@434 | 148 | string will be decoded and presented as genuine characters; the query |
paulb@434 | 149 | string will remain "URL encoded", however. |
paulb@434 | 150 | |
paulb@434 | 151 | If the optional 'encoding' is set, use that in preference to the default |
paulb@434 | 152 | encoding to convert the path into a form not containing "URL encoded" |
paulb@434 | 153 | character values. |
paulb@5 | 154 | """ |
paulb@5 | 155 | |
paulb@434 | 156 | path = self.get_path_without_query(encoding) |
paulb@434 | 157 | qs = self.get_query_string() |
paulb@434 | 158 | if qs: |
paulb@434 | 159 | return path + "?" + qs |
paulb@434 | 160 | else: |
paulb@434 | 161 | return path |
paulb@5 | 162 | |
paulb@434 | 163 | def get_path_without_query(self, encoding=None): |
paulb@162 | 164 | |
paulb@162 | 165 | """ |
paulb@434 | 166 | Returns the entire path from the request minus the query string as a |
paulb@434 | 167 | Unicode object containing genuine characters (as opposed to "URL |
paulb@434 | 168 | encoded" character values). |
paulb@434 | 169 | |
paulb@434 | 170 | If the optional 'encoding' is set, use that in preference to the default |
paulb@434 | 171 | encoding to convert the path into a form not containing "URL encoded" |
paulb@434 | 172 | character values. |
paulb@162 | 173 | """ |
paulb@162 | 174 | |
paulb@434 | 175 | return self.decode_path(self.trans.uri.split("?")[0], encoding) |
paulb@162 | 176 | |
paulb@434 | 177 | def get_path_info(self, encoding=None): |
paulb@1 | 178 | |
paulb@1 | 179 | """ |
paulb@186 | 180 | Returns the "path info" (the part of the URL after the resource name |
paulb@434 | 181 | handling the current request) from the request as a Unicode object |
paulb@434 | 182 | containing genuine characters (as opposed to "URL encoded" character |
paulb@434 | 183 | values). |
paulb@434 | 184 | |
paulb@434 | 185 | If the optional 'encoding' is set, use that in preference to the default |
paulb@434 | 186 | encoding to convert the path into a form not containing "URL encoded" |
paulb@434 | 187 | character values. |
paulb@1 | 188 | """ |
paulb@1 | 189 | |
paulb@439 | 190 | return decode_value("/%s" % "/".join(self.trans.postpath), encoding) |
paulb@1 | 191 | |
paulb@69 | 192 | def get_query_string(self): |
paulb@69 | 193 | |
paulb@69 | 194 | """ |
paulb@186 | 195 | Returns the query string from the path in the request. |
paulb@69 | 196 | """ |
paulb@69 | 197 | |
paulb@434 | 198 | t = self.trans.uri.split("?") |
paulb@69 | 199 | if len(t) == 1: |
paulb@69 | 200 | return "" |
paulb@69 | 201 | else: |
paulb@69 | 202 | |
paulb@69 | 203 | # NOTE: Overlook erroneous usage of "?" characters in the path. |
paulb@69 | 204 | |
paulb@69 | 205 | return "?".join(t[1:]) |
paulb@69 | 206 | |
paulb@1 | 207 | # Higher level request-related methods. |
paulb@1 | 208 | |
paulb@430 | 209 | def get_fields_from_path(self, encoding=None): |
paulb@69 | 210 | |
paulb@69 | 211 | """ |
paulb@249 | 212 | Extracts fields (or request parameters) from the path specified in the |
paulb@249 | 213 | transaction. The underlying framework may refuse to supply fields from |
paulb@430 | 214 | the path if handling a POST transaction. The optional 'encoding' |
paulb@430 | 215 | parameter specifies the character encoding of the query string for cases |
paulb@430 | 216 | where the default encoding is to be overridden. |
paulb@69 | 217 | |
paulb@71 | 218 | Returns a dictionary mapping field names to lists of values (even if a |
paulb@71 | 219 | single value is associated with any given field name). |
paulb@69 | 220 | """ |
paulb@69 | 221 | |
paulb@249 | 222 | fields = {} |
paulb@249 | 223 | for name, values in parse_qs(self.get_query_string(), keep_blank_values=1).items(): |
paulb@439 | 224 | name = decode_value(name, encoding) |
paulb@249 | 225 | fields[name] = [] |
paulb@249 | 226 | for value in values: |
paulb@439 | 227 | value = decode_value(value, encoding) |
paulb@430 | 228 | fields[name].append(value) |
paulb@249 | 229 | return fields |
paulb@69 | 230 | |
paulb@167 | 231 | def get_fields_from_body(self, encoding=None): |
paulb@69 | 232 | |
paulb@69 | 233 | """ |
paulb@249 | 234 | Extracts fields (or request parameters) from the message body in the |
paulb@249 | 235 | transaction. The optional 'encoding' parameter specifies the character |
paulb@249 | 236 | encoding of the message body for cases where no such information is |
paulb@249 | 237 | available, but where the default encoding is to be overridden. |
paulb@69 | 238 | |
paulb@73 | 239 | Returns a dictionary mapping field names to lists of values (even if a |
paulb@193 | 240 | single value is associated with any given field name). Each value is |
paulb@193 | 241 | either a Unicode object (representing a simple form field, for example) |
paulb@198 | 242 | or a plain string (representing a file upload form field, for example). |
paulb@69 | 243 | """ |
paulb@69 | 244 | |
paulb@249 | 245 | # There may not be a reliable means of extracting only the fields |
paulb@249 | 246 | # the message body using the API. Remove fields originating from the |
paulb@249 | 247 | # path in the mixture provided by the API. |
paulb@228 | 248 | |
paulb@249 | 249 | all_fields = self._get_fields(encoding) |
paulb@228 | 250 | fields_from_path = self.get_fields_from_path() |
paulb@249 | 251 | return filter_fields(all_fields, fields_from_path) |
paulb@224 | 252 | |
paulb@249 | 253 | def _get_fields(self, encoding=None): |
paulb@224 | 254 | encoding = encoding or self.get_content_type().charset or self.default_charset |
paulb@167 | 255 | fields = {} |
paulb@167 | 256 | for field_name, field_values in self.trans.args.items(): |
paulb@439 | 257 | field_name = decode_value(field_name, encoding) |
paulb@434 | 258 | |
paulb@228 | 259 | # Find the body values. |
paulb@228 | 260 | |
paulb@198 | 261 | if type(field_values) == type([]): |
paulb@198 | 262 | fields[field_name] = [] |
paulb@198 | 263 | |
paulb@198 | 264 | # Twisted stores plain strings. |
paulb@198 | 265 | |
paulb@198 | 266 | for field_str in field_values: |
paulb@439 | 267 | fields[field_name].append(decode_value(field_str, encoding)) |
paulb@198 | 268 | else: |
paulb@439 | 269 | fields[field_name] = decode_value(field_values, encoding) |
paulb@228 | 270 | |
paulb@167 | 271 | return fields |
paulb@1 | 272 | |
paulb@249 | 273 | def get_fields(self, encoding=None): |
paulb@249 | 274 | |
paulb@249 | 275 | """ |
paulb@249 | 276 | Extracts fields (or request parameters) from both the path specified in |
paulb@249 | 277 | the transaction as well as the message body. The optional 'encoding' |
paulb@249 | 278 | parameter specifies the character encoding of the message body for cases |
paulb@249 | 279 | where no such information is available, but where the default encoding |
paulb@249 | 280 | is to be overridden. |
paulb@249 | 281 | |
paulb@249 | 282 | Returns a dictionary mapping field names to lists of values (even if a |
paulb@249 | 283 | single value is associated with any given field name). Each value is |
paulb@249 | 284 | either a Unicode object (representing a simple form field, for example) |
paulb@249 | 285 | or a plain string (representing a file upload form field, for example). |
paulb@249 | 286 | |
paulb@249 | 287 | Where a given field name is used in both the path and message body to |
paulb@249 | 288 | specify values, the values from both sources will be combined into a |
paulb@249 | 289 | single list associated with that field name. |
paulb@249 | 290 | """ |
paulb@249 | 291 | |
paulb@249 | 292 | return self._get_fields(encoding) |
paulb@249 | 293 | |
paulb@45 | 294 | def get_user(self): |
paulb@1 | 295 | |
paulb@1 | 296 | """ |
paulb@186 | 297 | Extracts user information from the transaction. |
paulb@108 | 298 | |
paulb@108 | 299 | Returns a username as a string or None if no user is defined. |
paulb@1 | 300 | """ |
paulb@1 | 301 | |
paulb@128 | 302 | # Twisted makes headers lower case. |
paulb@128 | 303 | |
paulb@128 | 304 | if self.user is not None: |
paulb@128 | 305 | return self.user |
paulb@45 | 306 | |
paulb@49 | 307 | auth_header = self.get_headers().get("authorization") |
paulb@49 | 308 | if auth_header: |
paulb@49 | 309 | return UserInfo(auth_header).username |
paulb@49 | 310 | else: |
paulb@49 | 311 | return None |
paulb@1 | 312 | |
paulb@104 | 313 | def get_cookies(self): |
paulb@104 | 314 | |
paulb@104 | 315 | """ |
paulb@186 | 316 | Obtains cookie information from the request. |
paulb@104 | 317 | |
paulb@104 | 318 | Returns a dictionary mapping cookie names to cookie objects. |
paulb@104 | 319 | NOTE: Twisted does not seem to support this operation via methods. Thus, |
paulb@104 | 320 | NOTE: direct access has been employed to get the dictionary. |
paulb@104 | 321 | NOTE: Twisted also returns a plain string - a Cookie object is therefore |
paulb@104 | 322 | NOTE: introduced. |
paulb@104 | 323 | """ |
paulb@104 | 324 | |
paulb@258 | 325 | return self.process_cookies(self.trans.received_cookies, using_strings=1) |
paulb@104 | 326 | |
paulb@104 | 327 | def get_cookie(self, cookie_name): |
paulb@104 | 328 | |
paulb@104 | 329 | """ |
paulb@186 | 330 | Obtains cookie information from the request. |
paulb@104 | 331 | |
paulb@104 | 332 | Returns a cookie object for the given 'cookie_name' or None if no such |
paulb@104 | 333 | cookie exists. |
paulb@104 | 334 | NOTE: Twisted also returns a plain string - a Cookie object is therefore |
paulb@104 | 335 | NOTE: introduced. |
paulb@104 | 336 | """ |
paulb@104 | 337 | |
paulb@258 | 338 | value = self.trans.getCookie(self.encode_cookie_value(cookie_name)) |
paulb@258 | 339 | if value is not None: |
paulb@258 | 340 | return Cookie(cookie_name, self.decode_cookie_value(value)) |
paulb@258 | 341 | else: |
paulb@258 | 342 | return None |
paulb@104 | 343 | |
paulb@1 | 344 | # Response-related methods. |
paulb@1 | 345 | |
paulb@1 | 346 | def get_response_stream(self): |
paulb@1 | 347 | |
paulb@1 | 348 | """ |
paulb@186 | 349 | Returns the response stream for the transaction. |
paulb@1 | 350 | """ |
paulb@1 | 351 | |
paulb@224 | 352 | # Unicode can upset this operation. Using either the specified charset |
paulb@224 | 353 | # or a default encoding. |
paulb@167 | 354 | |
paulb@252 | 355 | encoding = self.get_response_stream_encoding() |
paulb@252 | 356 | return ConvertingStream(self.trans, encoding) |
paulb@252 | 357 | |
paulb@252 | 358 | def get_response_stream_encoding(self): |
paulb@252 | 359 | |
paulb@252 | 360 | """ |
paulb@252 | 361 | Returns the response stream encoding. |
paulb@252 | 362 | """ |
paulb@252 | 363 | |
paulb@167 | 364 | if self.content_type: |
paulb@224 | 365 | encoding = self.content_type.charset |
paulb@252 | 366 | else: |
paulb@252 | 367 | encoding = None |
paulb@252 | 368 | return encoding or self.default_charset |
paulb@1 | 369 | |
paulb@42 | 370 | def get_response_code(self): |
paulb@42 | 371 | |
paulb@42 | 372 | """ |
paulb@42 | 373 | Get the response code associated with the transaction. If no response |
paulb@42 | 374 | code is defined, None is returned. |
paulb@42 | 375 | """ |
paulb@42 | 376 | |
paulb@42 | 377 | # NOTE: Accessing the request attribute directly. |
paulb@42 | 378 | |
paulb@42 | 379 | return self.trans.code |
paulb@42 | 380 | |
paulb@42 | 381 | def set_response_code(self, response_code): |
paulb@42 | 382 | |
paulb@42 | 383 | """ |
paulb@42 | 384 | Set the 'response_code' using a numeric constant defined in the HTTP |
paulb@42 | 385 | specification. |
paulb@42 | 386 | """ |
paulb@42 | 387 | |
paulb@42 | 388 | self.trans.setResponseCode(response_code) |
paulb@42 | 389 | |
paulb@67 | 390 | def set_header_value(self, header, value): |
paulb@49 | 391 | |
paulb@49 | 392 | """ |
paulb@49 | 393 | Set the HTTP 'header' with the given 'value'. |
paulb@49 | 394 | """ |
paulb@49 | 395 | |
paulb@49 | 396 | self.trans.setHeader(self.format_header_value(header), self.format_header_value(value)) |
paulb@49 | 397 | |
paulb@1 | 398 | def set_content_type(self, content_type): |
paulb@1 | 399 | |
paulb@1 | 400 | """ |
paulb@186 | 401 | Sets the 'content_type' for the response. |
paulb@1 | 402 | """ |
paulb@1 | 403 | |
paulb@167 | 404 | # Remember the content type for encoding purposes later. |
paulb@167 | 405 | |
paulb@167 | 406 | self.content_type = content_type |
paulb@224 | 407 | self.trans.setHeader("Content-Type", str(content_type)) |
paulb@1 | 408 | |
paulb@104 | 409 | # Higher level response-related methods. |
paulb@104 | 410 | |
paulb@104 | 411 | def set_cookie(self, cookie): |
paulb@104 | 412 | |
paulb@104 | 413 | """ |
paulb@186 | 414 | Stores the given 'cookie' object in the response. |
paulb@104 | 415 | """ |
paulb@104 | 416 | |
paulb@258 | 417 | self.set_cookie_value(cookie.name, cookie.value, path=cookie.path, expires=cookie.expires) |
paulb@104 | 418 | |
paulb@104 | 419 | def set_cookie_value(self, name, value, path=None, expires=None): |
paulb@104 | 420 | |
paulb@104 | 421 | """ |
paulb@186 | 422 | Stores a cookie with the given 'name' and 'value' in the response. |
paulb@104 | 423 | |
paulb@104 | 424 | The optional 'path' is a string which specifies the scope of the cookie, |
paulb@104 | 425 | and the optional 'expires' parameter is a value compatible with the |
paulb@104 | 426 | time.time function, and indicates the expiry date/time of the cookie. |
paulb@104 | 427 | """ |
paulb@104 | 428 | |
paulb@258 | 429 | self.trans.addCookie(self.encode_cookie_value(name), |
paulb@258 | 430 | self.encode_cookie_value(value), expires=expires, path=path) |
paulb@104 | 431 | |
paulb@104 | 432 | def delete_cookie(self, cookie_name): |
paulb@104 | 433 | |
paulb@104 | 434 | """ |
paulb@186 | 435 | Adds to the response a request that the cookie with the given |
paulb@186 | 436 | 'cookie_name' be deleted/discarded by the client. |
paulb@104 | 437 | """ |
paulb@104 | 438 | |
paulb@108 | 439 | # Create a special cookie, given that we do not know whether the browser |
paulb@108 | 440 | # has been sent the cookie or not. |
paulb@108 | 441 | # NOTE: Magic discovered in Webware. |
paulb@108 | 442 | |
paulb@258 | 443 | self.trans.addCookie(self.encode_cookie_value(cookie_name), "", expires=0, path="/", max_age=0) |
paulb@104 | 444 | |
paulb@239 | 445 | # Session-related methods. |
paulb@239 | 446 | |
paulb@239 | 447 | def get_session(self, create=1): |
paulb@239 | 448 | |
paulb@239 | 449 | """ |
paulb@239 | 450 | Gets a session corresponding to an identifier supplied in the |
paulb@239 | 451 | transaction. |
paulb@239 | 452 | |
paulb@239 | 453 | If no session has yet been established according to information |
paulb@239 | 454 | provided in the transaction then the optional 'create' parameter |
paulb@239 | 455 | determines whether a new session will be established. |
paulb@239 | 456 | |
paulb@239 | 457 | Where no session has been established and where 'create' is set to 0 |
paulb@239 | 458 | then None is returned. In all other cases, a session object is created |
paulb@239 | 459 | (where appropriate) and returned. |
paulb@239 | 460 | """ |
paulb@239 | 461 | |
paulb@239 | 462 | # NOTE: Requires configuration. |
paulb@239 | 463 | |
paulb@239 | 464 | if self.session_store is None: |
paulb@239 | 465 | self.session_store = SessionStore(self, "WebStack-sessions") |
paulb@239 | 466 | return self.session_store.get_session(create) |
paulb@239 | 467 | |
paulb@239 | 468 | def expire_session(self): |
paulb@239 | 469 | |
paulb@239 | 470 | """ |
paulb@239 | 471 | Expires any session established according to information provided in the |
paulb@239 | 472 | transaction. |
paulb@239 | 473 | """ |
paulb@239 | 474 | |
paulb@239 | 475 | # NOTE: Requires configuration. |
paulb@239 | 476 | |
paulb@239 | 477 | if self.session_store is None: |
paulb@239 | 478 | self.session_store = SessionStore(self, "WebStack-sessions") |
paulb@239 | 479 | self.session_store.expire_session() |
paulb@239 | 480 | |
paulb@1 | 481 | # vim: tabstop=4 expandtab shiftwidth=4 |