Session Expire Time Problem

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Session Expire Time Problem

Postby fox » 21 Mar 2013, 23:45

I'm not seeing how close would be even called before the current page generation ends; session stuff uses a separate connection resource which is specified.

Yep, I grepped through it, and it's called by session thingie. Which kind of explains the problem you noticed there, yeah. Everywhere else looks safe enough not to bother.

miqrogroove
Bear Rating Trainee
Bear Rating Trainee
Posts: 39
Joined: 20 Mar 2013, 02:08

Re: Session Expire Time Problem

Postby miqrogroove » 21 Mar 2013, 23:57

fox wrote:I'm not seeing how close would be even called before the current page generation ends


I didn't run a backtrace but I can if that would be helpful.

session stuff uses a separate connection resource which is specified.


Your session logic is using the same connection represented by a second resource object. But that's just semantics.

When the resource isn't specified in the function call, you are using the default resource object, not necessarily the one that is still open.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Session Expire Time Problem

Postby fox » 22 Mar 2013, 08:46

Yeah I sort of figured that while brushing my teeth yesterday, you're right. Oh well.

miqrogroove
Bear Rating Trainee
Bear Rating Trainee
Posts: 39
Joined: 20 Mar 2013, 02:08

Re: Session Expire Time Problem

Postby miqrogroove » 22 Mar 2013, 14:33

I see the updates in github. It's for the best. One common strategy for dealing with this sort of thing is to put the DB abstraction into a class so that each connection resource becomes an object member. Then, one calls $db1->escape() or $db2->escape() etc instead of messing with function params.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Session Expire Time Problem

Postby fox » 22 Mar 2013, 14:42

Yeah, unfortunately that creates the amazingly fun task of rewriting pretty much anything which passes $links.

User avatar
raindog469
Bear Rating Trainee
Bear Rating Trainee
Posts: 17
Joined: 17 Mar 2013, 22:35

Re: Session Expire Time Problem

Postby raindog469 » 28 Mar 2013, 23:51

For mysql users looking for a quick fix, setting session.gc_maxlifetime to a very high number in php.ini (I used 2000000000) fixed the problem for me under Ubuntu 12.04. Might be a problem if you're running other PHP apps that make a lot of session files, but I'm not.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Session Expire Time Problem

Postby fox » 29 Mar 2013, 09:00

Trunk already stores sessions in the db for mysql, so that won't be necessary with 1.7.6.

downforce
Bear Rating Trainee
Bear Rating Trainee
Posts: 13
Joined: 04 Nov 2008, 01:10

Re: Session Expire Time Problem

Postby downforce » 04 Apr 2013, 10:12

Can I just say, thanks for fixing this!! Didn't realise how annoying it was until you've fixed it #threecheers!


Return to “Support”

Who is online

Users browsing this forum: No registered users and 11 guests