John McKenzie
2005-Apr-07 08:13 UTC
Problem with rails on windows using sessions, any help?
Hi, I''m a new rails/ruby user and am having troubles with sessions under windows. Maybe someone can help me? Env: Webrick,WindowsXPPro,MySQL Whenever I try to put an item in the session, and then retrieve it on a future page load, the item is nil. Somehow it is not persisting the session items after the request. I looked at the session files and there are hundreds of them, I thought that might be the problem. So I switched to use the ActiveRecordStore, and sure enough it creates hundreds of rows, but somehow without ever actually persisting something that I can get back. I tried debugging the cgi_process code and found that it seems to be creating a new CGI::Session object on every request. Is this normal behavior? I''m not too terribly good at debugging yet, I can''t figure out how to log or puts in there, but if I use global variables I can modify them and get it to puke by returning nil as the session. That''s how I figured out it was creating a new session on every request. Maybe someone also knows an easier way to debug the library code? Does anyone know what the problem is? I searched the mailing list archives and someone else asked a similar question 8 weeks ago without an answer. I love ruby and rails so far, but this has got me quite frustrated :/ Thanks for your help. James Dwyer