List Info

Thread: Sessions problem: most ignorant newbie yet...




Sessions problem: most ignorant newbie yet...
user name
2007-12-14 13:56:49
I've searched around on this list a bit for session-related difficulties and how to solve them, but I have yet to find anyone having this fundamental a problem:  I can't seem to get a .session in cherrypy at all.  There must be something really fundamental that I'm missing.

I set the "tools.sessions.on = True" in the config file, and I explicitly do the cherrypy.config.update() on the config file. ; Checking cherrypy.config.items(), it does contain ("tools.session.on", True).

But when I "import cherrypy" and take a look at what it contains, there is no .session, and so of course any attempt to manipulate it or any of its purported attributes, methods, etc., results in an exception.

I am using CherryPy 3.0.2.

Could someone please point me to the place in the documentation that I've obviously missed?

Many thanks.

TK

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Sessions problem: most ignorant newbie yet...
user name
2007-12-17 05:28:45
Instead of specifying it in the configuration file I put in
my root
class something like:


    _cp_config = { "tools.sessions.on": True,
                           
"tools.sessions.timeout": 0.5  # minutes
                         }

It worked!

-- tsf


On Dec 14, 5:56 pm, "Timothy Kendall"
<kendall.timo...gmail.com>
wrote:
> I've searched around on this list a bit for
session-related difficulties and
> how to solve them, but I have yet to find anyone having
this fundamental a
> problem:  I can't seem to get a .session in cherrypy at
all.  There must be
> something really fundamental that I'm missing.
>
> I set the "tools.sessions.on = True" in the
config file, and I explicitly do
> the cherrypy.config.update() on the config file. 
Checking
> cherrypy.config.items(), it does contain
("tools.session.on", True).
>
> But when I "import cherrypy" and take a look
at what it contains, there is
> no .session, and so of course any attempt to manipulate
it or any of its
> purported attributes, methods, etc., results in an
exception.
>
> I am using CherryPy 3.0.2.
>
> Could someone please point me to the place in the
documentation that I've
> obviously missed?
>
> Many thanks.
>
> TK
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Sessions problem: most ignorant newbie yet...
country flaguser name
United States
2007-12-17 11:52:46
Timothy Kendall wrote:
> I set the "tools.sessions.on = True" in the
config file, and I
> explicitly do the cherrypy.config.update() on the
config file.

Did you put that line inside a [global] section in the
config file?

> But when I "import cherrypy" and take a look
at what it contains,
> there is no .session, and so of course any attempt to
manipulate
> it or any of its purported attributes, methods, etc.,
results
> in an exception.

That's a side-effect of the CP innards--when you
"import cherrypy",
you're looking at dummy objects since the server hasn't been
started
yet. Because the session Tool is very optional, there's no
default dummy
object for cherrypy.session; it only gets added once you
start up the
server.


Robert Brewer
fumanchuaminus.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )