List Info

Thread: Session problems in IE7 using CP




Session problems in IE7 using CP
user name
2007-11-07 02:06:39
Hi All,

I am using cherrypy 2.2.0(beta). I have authenticate each page using my login screen.

I checked the session key for each page request, if the key is not found I have simply rdirect to my login page.

It is work in Mozilla firefox, but not works in IE7. Even I have checked the browser settings. All settings are correct.

Sometimes works in IE7 and most of the time not working. Even I can't able to reproduce the bug.

can anyone please tell me what are all the root causes?

The following code snippet is as follows

authfilter.py
========================================================================
import cherrypy
from cherrypy.filters.basefilter import BaseFilter

class AuthFilter(BaseFilter):

    def on_start_resource(self):
     ;   cherrypy.request.isAuthorized = False

    def before_request_body(self):
        if cherrypy.session.has_key('logged_in';):
     ;       cherrypy.request.isAuthorized = True
 ;       else:
          ;  cherrypy.request.isAuthorized = False

    def before_main(self):
        if not cherrypy.request.isAuthorized:
    ;        cherrypy.request.execute_main = True
 ;           cherrypy.request.object_path = 'Login'
==========================================================================

My Application Page
============================================================================
import authfilter
import cherrypy

class App:
 ;   _cp_filters = [ authfilter.AuthFilter() ]

    cherrypy.expose
 ;   def Login(self, **args):
    ;    import login
        return login.Render(args)

    cherrypy.expose
 ;   def Homepage(self):
 ;       import homepage
    ;    return homepage.Render ()

cherrypy.root = App()
cherrypy.config.update(file='myapp.conf')
cherrypy.server.start()
===============================================================================

myapp.conf file:
===============================================================================
[global]
server.environment = "development"
server.log_to_screen = True
server.log_tracebacks = True
server.thread_pool: 1
session_filter.on = True
server.socket_host = "0.0.0.0"
server.socket_port: 80
server.reverse_dns: False
static_filter.root = "/app/www"

[/static]
static_filter.on = True
static_filter.dir = "static"
===================================================================================

is there anything missing in that code?

Please help me to solve this issue.

Thanks in advance

- Mahabub Basha.S

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

[1]

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