durusmail: quixote-users: How to run session.ptl from demo application
How to run session.ptl from demo application
2002-07-22
2002-07-22
How to run session.ptl from demo application
Greg Ward
2002-07-22
On 22 July 2002, Samir Patel said:
> I modified demo.cgi to use SessionPublisher instread
> of Publisher

Why on earth would you want to do that?  The normal demo has no session
management.  If you want to run the session demo, use
demo/session_demo.cgi.

> and when I run
> "http://main.landrum-brown.com/cgi-bin/demo.cgi/session/",
> I got following error:
>
> Traceback (most recent call last):
>   File
> "/usr/lib/python2.2/site-packages/quixote/publish.py",
> line 624, in publish
>     output = self.try_publish(request,
> env.get('PATH_INFO', ''))
>   File
> "/usr/lib/python2.2/site-packages/quixote/publish.py",
> line 570, in try_publish
>     output = object(request)
>   File
> "/usr/lib/python2.2/site-packages/quixote/demo/session.ptl",
> line 82, in _q_index
>     """ % (html_quote(repr(session)),
> session.num_requests)
> AttributeError: Session instance has no attribute
> 'num_requests'

Oh, I think I see what's happening.  You're using SessionPublisher, but
you're not using the DemoSession class in session_demo.cgi.  You'll have
much better luck if you use session_demo.cgi instead of hacking demo.cgi
to serve up the session demo.

> when I directly access login page
> "http://main.landrum-brown.com/cgi-bin/demo.cgi/session/login"
>  and put some name, It created a cookie, but when I
> hit "back to start", it comes back with following
> message:
>
> Your session is invalid or has expired. Please reload
> this page to start a new session.Expired or invalid
> session: 17BB43A3EBD16BD9.

That's because you're trying to use non-persistent sessions with a plain
CGI driver script.  As I state several times in the documentation, this
will not work.  Use session_demo.cgi.

        Greg
--
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org


reply