Session Expire Time Problem

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
miqrogroove
Bear Rating Trainee
Bear Rating Trainee
Posts: 39
Joined: 20 Mar 2013, 02:08

Session Expire Time Problem

Postby miqrogroove » 21 Mar 2013, 16:21

I have to login to my reader several times per day, even though I configured it like this:

define('SESSION_COOKIE_LIFETIME', 5000000);
define('SESSION_EXPIRE_TIME', 5000000);
define('SESSION_CHECK_ADDRESS', 0);

I confirmed in Chrome settings that the cookies are not expiring. It doesn't happen every time I close the browser or every time I visit the site, but often enough to be a little annoying.

Is my session expire time value valid?

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, 16:32

If you are using mysql, tt-rss uses system implementation of sessions, which could be garbage collected by system cron tasks. Which is most probably what's happening here. Unfortunately this is outside of tt-rss control.

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, 16:39

The sessions table in the database is not yet implemented?

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, 16:42

Oh it is, for postgres. mysql has this disabled because of found issues (I think it breaks with either fcgid or mod_php for some reason).

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, 16:47

I'll look into writing the custom MySQL handler functions this weekend. It should be easy for me.

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, 16:48

You can force it in include/sessions.php (disable check for DB_TYPE).

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, 18:03

Confirmed, it is quite broken. I'll track down the bugs and add more handlers if needed.

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, 18:58

Yeah, I never bothered to investigate because I don't really use mysql. :)

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

Re: Session Expire Time Problem

Postby downforce » 21 Mar 2013, 19:36

miqrogroove, if you manage to fix this, please share as I'm keen! If you want any testers etc, please let me know. Cheers.

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, 20:38

I'll let you know this weekend. The system logged some db connection errors when I tested it, so that gives me a pretty solid idea where the problems are.

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, 21:42

I don't get it. Won't this help?

https://github.com/gothfox/Tiny-Tiny-RS ... 4267dc63fc

Edit: for all I know this might break mysql support.

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, 21:45


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, 21:47

I'm going to add a default link value to simplify the mess. Just passing NULL by default will cause problems.

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, 21:52

Why? It checks for that. Also it looks like mysql started working with db sessions for me.

Edit: ok I'm having other reports that it works and I can't believe it was that simple to fix. Goddamn.

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:40

fox wrote:Why? It checks for that.


No, it doesn't. What's happening here is mysql_close() is being called before mysql_real_escape_string(). As long as you never call mysql_close() the $link and $session_connection resources are identical and mysql_real_escape_string() has a valid default. As soon as you call mysql_close() you get one valid resource and one invalid resource. At that point the default link may or may not be valid depending on which is the default. If the resources are ever opened or closed in a different order, you will get a different result. The only way to prevent this error from coming up again is to always specify the link being used.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 12 guests