From: andrew mcelroy Date: 2012-05-31T01:38:07+09:00 Subject: Re: CGI::Session - New session created everytime session is hit. --001636c5c035456a2404c1439315 Content-Type: text/plain; charset=ISO-8859-1 On Wed, May 30, 2012 at 11:26 AM, Doug Jolley wrote: > It is my understanding that when a new session instance is created by > invoking CGI::Session.new, the instance created will be a continuation > of the existing session if one exists. Otherwise, the instance created > will create a new session. I recently encountered the situation where > the instance created was always a new session regardless of whether > there was an existing session. After doing some Googleing I found that > I was able to solve the problem by including a 'session_path'=>'/' > option. After doing some re-arrangement of the code, I find that my > problem has returned. > > I'm thinking that I might be able to again fix the problem by changing > the path of the option; but, I have no idea what it should be changed > to. (BTW. I tried omitting the option entirely; but, that didn't fix > the problem.) My efforts to discover what '/' should be changed to are > frustrated by the fact that I really have no idea what this option does. > The documentation is not very helpful saying only that the session_path > is, "the path for which the session applies" and that it defaults to the > directory of the CGI script. > > Can someone help me better understand what this option does so that > hopefully I will be able to fix this problem? Naturally any specific > guidance on fixing the problem directly would also be appreciated. > > Thanks for any input. > Take a look at the legacy version of tryruby. I used CGI directly and did not have this issue. It may help answer your question. https://github.com/Sophrinix/TryRuby/blob/legacy/non-rack-legacy/public/irb.cgi Andrew McElroy > > ... doug > > -- > Posted via http://www.ruby-forum.com/. > > --001636c5c035456a2404c1439315 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, May 30, 2012 at 11:26 AM, Doug J= olley <lists@ruby-forum.com> wrote:
It is my understanding that when a new session instance is created by
invoking CGI::Session.new, the instance created will be a continuation
of the existing session if one exists. =A0Otherwise, the instance created will create a new session. =A0I recently encountered the situation where the instance created was always a new session regardless of whether
there was an existing session. =A0After doing some Googleing I found that I was able to solve the problem by including a 'session_path'=3D>= ;'/'
option. After doing some re-arrangement of the code, I find that my
problem has returned.

I'm thinking that I might be able to again fix the problem by changing<= br> the path of the option; but, I have no idea what it should be changed
to. =A0(BTW. I tried omitting the option entirely; but, that didn't fix=
the problem.) =A0My efforts to discover what '/' should be changed = to are
frustrated by the fact that I really have no idea what this option does. The documentation is not very helpful saying only that the session_path
is, "the path for which the session applies" and that it defaults= to the
directory of the CGI script.

Can someone help me better understand what this option does so that
hopefully I will be able to fix this problem? =A0Naturally any specific
guidance on fixing the problem directly would also be appreciated.

Thanks for any input.


Ta= ke a look at the legacy version of tryruby. I used CGI directly and did not= have this issue.
It may help answer your question.

https://github.com/Sophrinix/TryRuby/blob/l= egacy/non-rack-legacy/public/irb.cgi

Andrew Mc= Elroy
=A0

=A0 =A0 =A0 ... doug

--
Posted via http://= www.ruby-forum.com/.


--001636c5c035456a2404c1439315--