I've just tested on your most recent release, 3.0.1, and it
still
occurs.
Thanks again,
Gloria
On Mar 8, 6:33 pm, "Gloria" <strang... comcast.net> wrote:
> Hi all,
>
> I have an odd session variable bug I am seeing. Here's
what's
> happening.
> I set a session variable to True if a user uses an
admin password to
> get into our web site.
> First time logging in: It appears to be set in the
first page:
>
> >
/home/lii/CherryPy/user_auth/login.py(304)validate_user()
>
> -> if cherrypy.session.get('admin_role'):
> (Pdb)>
/home/lii/CherryPy/user_auth/login.py(305)validate_user()
>
> -> entry = "%s: Caregiver_id: 1 login:
%s FROM:
> %s TO: %s" %
(date_now,cherrypy.session['email'],wfrom,wto)
> (Pdb) p cherrypy.session.get('admin_role')
> True
> (Pdb)
>
> Looks good. And the page to which I HTTPRedirect:
>
> -> print "nn***********Internal admin:"
+
> str(cherrypy.session.get('admin_role'))
> (Pdb) n
> ***********Internal admin:True
>
> Also looks good.
>
> Now I back-arrow to the login screen again, and repeat
the process.
> First page:
>
> >
/home/lii/CherryPy/user_auth/login.py(304)validate_user()
>
> -> if cherrypy.session.get('admin_role'):
> (Pdb)>
/home/lii/CherryPy/user_auth/login.py(305)validate_user()
>
> -> entry = "%s: Caregiver_id: 1 login:
%s FROM:
> %s TO: %s" %
(date_now,cherrypy.session['email'],wfrom,wto)
> (Pdb)>
/home/lii/CherryPy/user_auth/login.py(309)validate_user()
>
> -> try:
> (Pdb) p cherrypy.session.get('admin_role')
> True
>
> Looks good.
>
> Now the page to which I HTTPRdirect, same page as
before:
>
> >
/home/lii/CherryPy/user_auth/login.py(82)page_to_page_valida
tion()
>
> -> print "nn***********Internal admin:"
+
> str(cherrypy.session.get('admin_role'))
> (Pdb) n
> ***********Internal admin:None
>
> It gets stranger. Look at the dictionary:
>
> (Pdb) p cherrypy.session.__dict__
> {'__module__': 'cherrypy.lib.sessions', 'locked': True,
'_save':
> <function _save at 0xb7ba7f7c>, 'acquire_lock':
<function acquire_lock
> at 0xb7baf02c>, '_delete': <function _delete at
0xb7ba7fb4>,
> 'clean_freq': 60, 'cache':
> {'e16571e5cd712cae0a326eb7c398e5bcb6a322a0':
({'demo_mode': False,
> 'DOMAIN': 'xxx.com', 'group_ids': {1771: 'vvv Hall
All', 966: 'Nigel
> Test vvv', 972: 'vvv Courtyard all', 778: 'Test unit
2', 1163: 'vvv
> Housing all', 1356: 'Lime Tree House', 783: 'Test unit
3', 1936:
> 'Croydon All', 2356: 'vvv Project', 1943: 'vvv Falls
Team All', 1529:
> 'vvv Team', 1660: 'vvv trial', 669: 'vvv Pilot', 2334:
'vvv SteveL
> testing', 607: 'Steve vvv vvv test'}, 'client_ids':
[1071, 1187, 1387,
> 1388, 1389, 1390, 1391, 1392, 1542, 1545, 1547, 1549,
1552, 1553,
> 1555, 1556, 1557, 1559, 1560, 1561, 1562, 1604, 1703,
1787, 1788,
> 1821, 1956, 1971, 1988, 2082, 2098, 2126, 2234, 2267,
2268, 2421,
> 2436, 2437, 2439, 2440, 2467, 2468, 2503, 2504, 2512,
2513, 2515,
> 2689, 2720], 'hex_password':
'$1$WAWAQDTR$S9SgRhkKtL4V.T1BvGHu31',
> 'caregiver_firstname': 'Steve', 'institution_name':
'vvv',
> 'admin_role': True, 'institution_id': 9, ...
>
> My session variable appears there, in the last line. I
can't get to it
> by normal means, though:
>
> (Pdb) p cherrypy.session.get('admin_role')
> None
> (Pdb) p cherrypy.session['admin_role']
> *** KeyError: KeyError('admin_role',)
> (Pdb)
>
> I am clearing and resetting session data each time a
person logs in.
>
> If one of the CherryPy developers wants to debug this
live, contact
> me, and I will give you access to our system.
>
> Thank you,
> Gloria
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|