Thanks Aaron.........sorry if I offended anyone ;-) but it was my
mistake for using such a vague term to just mean "any good old program"
(like your example there).
So I will presume there is nothing in the default webware package in the
Admin area to do the following:
1. View/inspect/manipulate existing sessions
2. Expire existing sessions
I just didn't want to reinvent the wheel is all.
Thanks again.
Huy
Aaron Held wrote:
> Tools, we don't need no tools, Python developers barely even need a
> framework. If I wanted tools to make life easier I would program in
> Java or .NET Then I could just draw a picture of my website and it
> would all work..... hmmmm where is that .net CD I got in the mail.....
>
> Here is my servlet: Status.py
>
>
> from SecurePage import SecurePage
> from time import strftime,gmtime
>
> class Status(SecurePage):
> def __init__(self):
> SecurePage.__init__(self)
>
> def writeDataRow(self,one,two):
> self.writeln('<tr><td>%s:</td><td>%s</td></tr>' % (one,two))
>
> def writeContent(self):
> self.writeln('<table><tr><td>')
> user=self.session().value('user')
> self.writeln('There are currently %s active sessions' %
> len(self.application().sessions().keys()))
> for sess in self.application().sessions().keys():
> self.writeln('<br><br>Session Key: %s' % sess)
> thisSession = self.application().session(sess)
> self.writeln('<br>Active Since: %s' % strftime("%a, %d
> %b %Y %H:%M:%S %Z", gmtime(thisSession.creationTime())))
> self.writeln('<br>Last Access: %s' % strftime("%a, %d
> %b %Y %H:%M:%S %Z", gmtime(thisSession.lastAccessTime())))
> self.writeln('<table>')
> if thisSession.hasValue('user'):
> self.writeDataRow('UserName','<b>' +
> str(thisSession.value('user')) + '</b>')
> if thisSession.hasValue('CurrentSQL'):
> self.writeDataRow('Current SQL
> Statement',thisSession.value('CurrentSQL').genSQL())
> if thisSession.hasValue('rsSize'):
> self.writeDataRow('Current Result Set
> Size',str(thisSession.value('rsSize')) + ' Records')
> self.writeln('</table>')
> else:
> thisSession = self.session()
> self.writeln('<br>Active Since: %s' % strftime("%a, %d %b
> %Y %H:%M:%S %Z", gmtime(thisSession.creationTime())))
> self.writeln('<br>Last Access: %s' % strftime("%a, %d %b %Y
> %H:%M:%S %Z", gmtime(thisSession.lastAccessTime())))
> #self.writeln(thisSession.values().keys())
> self.writeln('<table>')
> if thisSession.hasValue('user'):
> self.writeDataRow('UserName','<b>' +
> str(thisSession.value('user')) + '</b>')
> if thisSession.hasValue('CurrentSQL'):
> self.writeDataRow('Current SQL
> Statement',thisSession.value('CurrentSQL').genSQL())
> if thisSession.hasValue('rsSize'):
> self.writeDataRow('Current Result Set
> Size',str(thisSession.value('rsSize')) + ' Records')
> self.writeln('</table>')
>
>
> self.writeln('</td></tr></table>')
>
> The action is:
>
> 1) get a list of session keys:
> for sess in self.application().sessions().keys():
> self.writeln('<br><br>Session Key: %s' % sess)
> 2) get each session
> thisSession = self.application().session(sess)
> 3) dump whatever info you need:
> if thisSession.hasValue('user'):
> self.writeDataRow('UserName','<b>' +
> str(thisSession.value('user')) + '</b>')
>
> -Aaron
>
> Huy Do wrote:
>
>> Hi,
>>
>> Just wondering if there was an existing tool in webware to view and
>> manually expire sessions.
>>
>> Basic details like when the session was created, last accessed etc.
>>
>> Thanks
>>
>> Huy
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: If flattening out C++ or Java
>> code to make your application fit in a relational database is
>> painful, don't do it! Check out ObjectStore. Now part of Progress
>> Software.
>> http://www.objectstore.net/sourceforge
>> _______________________________________________
>> Webware-discuss mailing list
>> Webware-discuss@...
>> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: If flattening out C++ or Java
> code to make your application fit in a relational database is painful,
> don't do it! Check out ObjectStore. Now part of Progress Software.
> http://www.objectstore.net/sourceforge
> _______________________________________________
> Webware-discuss mailing list
> Webware-discuss@...
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
|