From: matz@... (Yukihiro Matsumoto) Date: 2000-12-31T22:39:18+09:00 Subject: [ruby-talk:8411] Re: Problem - CGI::Session (long) Hi, In message "[ruby-talk:8374] Problem - CGI::Session (long)" on 00/12/31, "Guy N. Hurst" writes: |I would like every visitor to resume their session unless it is |their first visit - in which case I would like to create a new |session. But I don't know this until I check for an existing session. | |When calling CGI::Session.new, if I do not specifically provide a |session_id or do not specifically ask for a one to be created, |then I would like the module to check for a session id from the cgi |instance, and then from the cookies. If it still doesn't have one |after all this, then I would like for it to create one - regardless |of whether new_session was specified. the behavior of new_session is: true | should start new session; session id must not be | provided. --------------|------------------------------------------------------ false | should continue existing session; requires session | id to be provided/created. --------------|------------------------------------------------------ not supplied | start new session, or continue existing session, | depending upon the context So if you DO NOT supply new_session at all, I think you have what you want. |But I cannot guarantee that the new_session key will or will not be |an entry in the options hash, and I would certainly like to |guarantee a new session in case I can't recover an existing one. I don't know the reason why you cannot garantee. Why don't you simply remove 'new_session' from the option hash in that case? matz.