> I don't think extraURLPath will help him -- (my impression is that) he
> wants to use the current Servlet path mechanism, but with the SID at
> the root of that path.
that is right, the advantage is, that one can write simple links like
href=OtherPage instead of href=OtherPage?_SID_=xyz or
href=OtherPage/_SID_/xyz/
i added code to Application.py, HTTPRequest.py and Application.config
and it seems to work :-)
since i am not too familiar with WebKit, i am not sure if this is a
pretty solution.
i attatched my diffs.
> As it is, there's just a heap of code he'll have to sift through :-(
no prob, that was fun :-))
--
brainbot technologies AG
schwalbacherstr. 74 65183 wiesbaden . germany
vox +49 611 238505-0 fax ++49 611 238505-1
http://brainbot.com/ mailto:[EMAIL PROTECTED]
? WebWare.diff
? WebKit/appserverpid.txt
? WebKit/Configs/Application.config_
? WebKit/Examples/T
? WebKit/Tasks/__init__.pyc
? WebKit/Tasks/SessionTask.pyc
Index: WebKit/Application.py
===================================================================
RCS file: /cvsroot/webware/Webware/WebKit/Application.py,v
retrieving revision 1.110
diff -r1.110 Application.py
323a324
>
336a338
>
339a342,345
>
> elif self.setting('UseAutomaticPathSessions') and not
>request.hasPathSession():
> self.handleMissingPathSession(transaction)
>
341a348
>
343a351
>
376a385,405
>
> def handleMissingPathSession(self,transaction):
> # if UseAutomaticPathSessions is enabled in Application.config
> # we redirect the browser to a url with SID in path
> # http://gandalf/a/_SID_=2001080221301877755/Examples/
> # _SID_ is extracted and removed from path in HTTPRequest.py
>
> # this is for convinient building of webapps that must not
> # depend on cookie support
>
> newSid = transaction.session().identifier()
> request = transaction.request()
> url = request.adapterName() + '/_SID_='+ newSid + '/' +
>request.pathInfo()
> if request.queryString():
> url += '?' + request.queryString()
> if self.setting('Debug')['Sessions']:
> print ">> [sessions] handling UseAutomaticPathSessions,
>redirecting to", url
> transaction.response().sendRedirect(url)
>
>
>
444a474,475
>
>
449c480,483
< self.handleGoodURL(transaction)
---
> if self.setting('UseAutomaticPathSessions'):
> self.handleMissingPathSession(transaction)
> else:
> self.handleGoodURL(transaction)
Index: WebKit/HTTPRequest.py
===================================================================
RCS file: /cvsroot/webware/Webware/WebKit/HTTPRequest.py,v
retrieving revision 1.28
diff -r1.28 HTTPRequest.py
40a41
>
50a52,53
>
>
115a119,139
>
>
>
> # try to get automatic path session
> # if UseAutomaticPathSessions is enabled in Application.config
> # Application.py redirects the browser to a url with SID in path
> # http://gandalf/a/_SID_=2001080221301877755/Examples/
> # _SID_ is extracted and removed from path
> self._pathSession = None
> if self._environ['PATH_INFO'][1:6] == '_SID_':
> self._pathSession =
>self._environ['PATH_INFO'][7:].split('/',1)[0]
> self._cookies['_SID_'] = self._pathSession
> sidstring = '_SID_=' + self._pathSession +'/'
> self._environ['REQUEST_URI'] =
>self._environ['REQUEST_URI'].replace(sidstring,'')
> self._environ['PATH_INFO'] =
>self._environ['PATH_INFO'].replace(sidstring,'')
> self._environ['PATH_TRANSLATED'] =
>self._environ['PATH_TRANSLATED'].replace(sidstring,'')
> assert(not self._environ.has_key('WK_URI')) # obsolet?
>
>
>
>
117a142,143
>
>
427a454,455
> def hasPathSession(self):
> return self._pathSession is not None
Index: WebKit/Session.py
===================================================================
RCS file: /cvsroot/webware/Webware/WebKit/Session.py,v
retrieving revision 1.14
diff -r1.14 Session.py
143c143
< sid = '__SID__' + self.identifier()
---
> sid = '_SID_' + self.identifier()
Index: WebKit/Configs/Application.config
===================================================================
RCS file: /cvsroot/webware/Webware/WebKit/Configs/Application.config,v
retrieving revision 1.35
diff -r1.35 Application.config
21a22
> 'UseAutomaticPathSessions': 1,
23a25
>