That is because you are probably using  proxy (mod_proxy?). The ip
address stored in db does not affect validation.

In gluon/globals.py there is

             try:
                 key=request.cookies[response.session_id_name].value
                 record_id,unique_key=key.split(':')
                 if record_id=='0': raise Exception
                 rows=db(table.id==record_id).select()
                 if len(rows)==0 or rows[0].unique_key!=unique_key:
                     raise Exception, "No record"
                 #rows[0].update_record(locked=True)
                 session_data=cPickle.loads(rows[0].session_data)
                 self.update(session_data)
             except Exception, e:

can you change it to

             try:
                 key=request.cookies[response.session_id_name].value
                 print key
                 record_id,unique_key=key.split(':')
                 if record_id=='0': raise Exception
                 print 'here'
                 rows=db(table.id==record_id).select()
                 print rows
                 if len(rows)==0 or rows[0].unique_key!=unique_key:
                     raise Exception, "No record"
                 #rows[0].update_record(locked=True)
                 print 'here'
                 session_data=cPickle.loads(rows[0].session_data)
                 print session_data
                 self.update(session_data)
                 print 'there'
             except Exception, e:

restart web2py, reload the page a couple of time and tell me what this
output to the console?

Massimo




On Oct 21, 8:25 pm, ceej <[EMAIL PROTECTED]> wrote:
> It happens when i put it on my remote linux server and use mysql on
> there not on my mac. I think I found out why it creates a new session
> on every page load though.
>
> I looked at the records it was creating, and all the client_ip fields
> were filled with 127.0.0.1.
>
> My ip is not 127.0.0.1 as the website is hosted on webfaction.
>
> If you can try on a server you will defiantly be able to recreate what
> I'm getting. This is a serious issue for anyone wanting to have a
> production site running on a server using mysql to hold the sessions.
>
> Many thanks,
>
> On Oct 20, 12:36 pm, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > Hi Ceej,
>
> > I installed MySQL on my Mac (which was a pain) but I cannot reproduce
> > the problem. I remember when you first raised the issue there was a
> > problem with the file size. It was fixed then. It you possible your
> > 'sessions' table did not migrate. I suggest manually remove the table
> > and the associated .table files.
>
> > I did have one problem with mysql on mac. Because of a MySQL bug that
> > was supposedly fixed (not on the version I have) this statement issues
> > by web2py "SET sql_mode='NO_BACKSLASH_ESCAPES';" results in an
> > OperationalError. In order to test the issue you raised I had to
> > comment that line in sql.py
>
> > Massimo
>
> > On Oct 17, 2:11 pm, ceej <[EMAIL PROTECTED]> wrote:
>
> > > Hi there,
>
> > > If i use session.connect(request,response,tablename='sessions',db=db)
> > > on my production server which uses MySQL It resets the sessions on
> > > every page load, it works fine in my development server that uses
> > > sqlite. I know i mentioned this before, did you get a chance to have a
> > > look at it?
>
> > > Many thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to