Discussion:
using sharedSession
Helio MC Pereira
2005-06-05 19:00:23 UTC
Permalink
Hi Irmen,

Have one question with sharedSession = True in wepapps inside the same
virtualhost.

All webapps in the virtualhost shared the SessionCtx? Can all write in
SessionCtx and be disponible to all webapps (root webapps to) ?

I'm doing some tests and I can't put it to work :P

have 3 webapps in the same vhost:
1- vhost = http://shkl.codezone.ath.cx/ - have sharedSession
2- /xixi/ - have sharedSession
3- /manage/ - don't have sharedSession

in root index.y are allways writing self.SessionCtx.wapp {} because it
don't exist.
Am I doing something wrong?
you can try it in http://shkl.codezone.ath.cx/

Thanks for all,
Helio Pereira

root index.y
<%
if not hasattr(self.SessionCtx, 'wapp'):
self.SessionCtx.wapp = {}
self.write("Create self.SessionCtx.wapp{}")
self.write("<br>")

if not self.SessionCtx.wapp.has_key('root'):
self.SessionCtx.wapp['root'] = "Principal"
self.write("add self.SessionCtx.wapp['root']")
else:
self.write("don't do nothing... great :-)")



xixi index.y
<%
if not self.SessionCtx.wapp.has_key('xixi'):
self.SessionCtx.wapp['xixi'] = "Vai fazer xixi"
self.write("add self.SessionCtx.wapp['xixi']")
else:
self.write("don't do nothing... great :-)")


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r
Helio MC Pereira
2005-06-05 21:35:03 UTC
Permalink
well, trying understand if it is my problem, i realize that the root
webapp have allways a new sessioID in every request and the webapp
'xixi' from the same vhost have only one session in every request.

When the server try 'delete' the session from root webapp it gives an
errors and dies...

Here is the error from server_console.log
**** ERROR OCCURRED IN SERVER! (Sun Jun 5 20:18:39 2005 GMT) ****
Traceback (most recent call last):
File "./monitor.py", line 87, in checkServer
serv.main(workingdir=SERVER_DIR)
File "/home/sharky/Snakelets/Server1.41/serv.py", line 30, in main
writePageSource=False,
File "/home/sharky/Snakelets/Server1.41/snakeserver/server.py", line
1088, in main
httpd.serve_forever()
File "/home/sharky/Snakelets/Server1.41/snakeserver/server.py", line
909, in serve_forever
self.reapSessions()
File "/home/sharky/Snakelets/Server1.41/snakeserver/server.py", line
989, in reapSessions
webapp.sessions.scanSessionTimeouts()
File "/home/sharky/Snakelets/Server1.41/snakeserver/websession.py",
line 49, in scanSessionTimeouts
session.destroyIfOverAged()
File "/home/sharky/Snakelets/Server1.41/snakeserver/websession.py",
line 125, in destroyIfOverAged
self.destroy()
File "/home/sharky/Snakelets/Server1.41/snakeserver/websession.py",
line 116, in destroy
self.webappref()._deleteSession(self, self.responseref())
File "/home/sharky/Snakelets/Server1.41/snakeserver/webapp.py", line
936, in _deleteSession
del self.sessions[session.getID()]
File "/home/sharky/Snakelets/Server1.41/snakeserver/websession.py",
line 44, in __delitem__
dict.__delitem__(self,key)
KeyError: '31fc59bebda2a7b6683654ceaa98875c'
**** END OF ERROR, EXITING! ****
Post by Helio MC Pereira
Hi Irmen,
Have one question with sharedSession = True in wepapps inside the same
virtualhost.
All webapps in the virtualhost shared the SessionCtx? Can all write in
SessionCtx and be disponible to all webapps (root webapps to) ?
I'm doing some tests and I can't put it to work :P
1- vhost = http://shkl.codezone.ath.cx/ - have sharedSession
2- /xixi/ - have sharedSession
3- /manage/ - don't have sharedSession
in root index.y are allways writing self.SessionCtx.wapp {} because it
don't exist.
Am I doing something wrong?
you can try it in http://shkl.codezone.ath.cx/
Thanks for all,
Helio Pereira
root index.y
<%
self.SessionCtx.wapp = {}
self.write("Create self.SessionCtx.wapp{}")
self.write("<br>")
self.SessionCtx.wapp['root'] = "Principal"
self.write("add self.SessionCtx.wapp['root']")
self.write("don't do nothing... great :-)")
xixi index.y
<%
self.SessionCtx.wapp['xixi'] = "Vai fazer xixi"
self.write("add self.SessionCtx.wapp['xixi']")
self.write("don't do nothing... great :-)")
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r
Helio MC Pereira
2005-06-18 01:08:26 UTC
Permalink
Hi Irmen,

Making more tests, but now playing with your shared1 and shared2 examples.

If I make one virtual host with shared1 as a ROOT webapp and
shared2 as a "sub"webapp, they don't work (they don't shared the
session).

Can you please have a try?

Here is my webapp.__init__.py configuration:

ENABLED = True
virtualhosts = {
"shkl.codezone.ath.cx" : ("shared2",),
}
webroots = {
"shkl.codezone.ath.cx" : "shared1"
}
aliases= {}
defaultvhost = "shkl.codezone.ath.cx"



---------- Forwarded message ----------
From: Helio MC Pereira <helio.mc.pereira-***@public.gmane.org>
Date: 05/06/2005 22:35
Subject: Re: using sharedSession
To: "[ml] Snakelets" <snakelets-list-5NWGOfrQmneRv+***@public.gmane.org>


well, trying understand if it is my problem, i realize that the root
webapp have allways a new sessioID in every request and the webapp
'xixi' from the same vhost have only one session in every request.

When the server try 'delete' the session from root webapp it gives an
errors and dies...

Here is the error from server_console.log
**** ERROR OCCURRED IN SERVER! (Sun Jun 5 20:18:39 2005 GMT) ****
Traceback (most recent call last):
File "./monitor.py", line 87, in checkServer
serv.main(workingdir=SERVER_DIR)
File "/home/sharky/Snakelets/Server1.41/serv.py", line 30, in main
writePageSource=False,
File "/home/sharky/Snakelets/Server1.41/snakeserver/server.py", line
1088, in main
httpd.serve_forever()
File "/home/sharky/Snakelets/Server1.41/snakeserver/server.py", line
909, in serve_forever
self.reapSessions()
File "/home/sharky/Snakelets/Server1.41/snakeserver/server.py", line
989, in reapSessions
webapp.sessions.scanSessionTimeouts()
File "/home/sharky/Snakelets/Server1.41/snakeserver/websession.py",
line 49, in scanSessionTimeouts
session.destroyIfOverAged()
File "/home/sharky/Snakelets/Server1.41/snakeserver/websession.py",
line 125, in destroyIfOverAged
self.destroy()
File "/home/sharky/Snakelets/Server1.41/snakeserver/websession.py",
line 116, in destroy
self.webappref()._deleteSession(self, self.responseref())
File "/home/sharky/Snakelets/Server1.41/snakeserver/webapp.py", line
936, in _deleteSession
del self.sessions[session.getID()]
File "/home/sharky/Snakelets/Server1.41/snakeserver/websession.py",
line 44, in __delitem__
dict.__delitem__(self,key)
KeyError: '31fc59bebda2a7b6683654ceaa98875c'
**** END OF ERROR, EXITING! ****
Post by Helio MC Pereira
Hi Irmen,
Have one question with sharedSession = True in wepapps inside the same
virtualhost.
All webapps in the virtualhost shared the SessionCtx? Can all write in
SessionCtx and be disponible to all webapps (root webapps to) ?
I'm doing some tests and I can't put it to work :P
1- vhost = http://shkl.codezone.ath.cx/ - have sharedSession
2- /xixi/ - have sharedSession
3- /manage/ - don't have sharedSession
in root index.y are allways writing self.SessionCtx.wapp {} because it
don't exist.
Am I doing something wrong?
you can try it in http://shkl.codezone.ath.cx/
Thanks for all,
Helio Pereira
root index.y
<%
self.SessionCtx.wapp = {}
self.write("Create self.SessionCtx.wapp{}")
self.write("<br>")
self.SessionCtx.wapp['root'] = "Principal"
self.write("add self.SessionCtx.wapp['root']")
self.write("don't do nothing... great :-)")
xixi index.y
<%
self.SessionCtx.wapp['xixi'] = "Vai fazer xixi"
self.write("add self.SessionCtx.wapp['xixi']")
self.write("don't do nothing... great :-)")
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
Irmen de Jong
2005-06-28 18:35:57 UTC
Permalink
Post by Helio MC Pereira
If I make one virtual host with shared1 as a ROOT webapp and
shared2 as a "sub"webapp, they don't work (they don't shared the
session).
it seems that there is a problem with (shared?) sessions and webapps
running in the root context.
Will look into this. Sorry for not responding earlier, but I have
been rather busy with other things.

--Irmen


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Irmen de Jong
2005-09-08 20:35:18 UTC
Permalink
Post by Helio MC Pereira
Hi Irmen,
Making more tests, but now playing with your shared1 and shared2 examples.
If I make one virtual host with shared1 as a ROOT webapp and
shared2 as a "sub"webapp, they don't work (they don't shared the
session).
Can you please have a try?
I tracked down the problem and fixed it in CVS,
so the upcoming Snakelets 1.42 release will work as expected.

--Irmen



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
Loading...