How to keep myself logged in?

If you run tt-rss on an officially unsupported platform (shared hosting, Windows, etc.) post here
anteatersa
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 15 Mar 2013, 00:50

How to keep myself logged in?

Postby anteatersa » 26 May 2016, 16:46

How can I keep myself logged into ttrss for a long time e.g. one year. Am tired of logging in every few hours or every morning

Things I have tried so far:

define('SESSION_COOKIE_LIFETIME', 31536000);
define('SESSION_EXPIRE_TIME', 31536000);

in settings has no effect.

I have set: $session_expire = 31536000; in /include/sessions.php

None of these do anything and I have to log back in after a few hours of inactivity.

disconn3ct
Bear Rating Trainee
Bear Rating Trainee
Posts: 37
Joined: 12 Apr 2013, 15:07

Re: How to keep myself logged in?

Postby disconn3ct » 26 May 2016, 18:14

Try -1.

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

Re: How to keep myself logged in?

Postby fox » 26 May 2016, 18:52

session should prolong itself as long as you're actually logging in from time to time

i don't think -1 is going to work but idk

disconn3ct
Bear Rating Trainee
Bear Rating Trainee
Posts: 37
Joined: 12 Apr 2013, 15:07

Re: How to keep myself logged in?

Postby disconn3ct » 26 May 2016, 19:03

-1 has been working for me.

extra808
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 26 May 2016, 19:21

Re: How to keep myself logged in?

Postby extra808 » 26 May 2016, 19:30

In config.php, I have
define('SESSION_COOKIE_LIFETIME', 604800); // 604800 == 1 week
and my session does indeed last about a week
I don't have SESSION_EXPIRE_TIME at all. If -1 works, great, but otherwise I'd look at what your browser is doing with your cookies, maybe some privacy extension is deleting them if you can't go more than a day. I also wonder about your ip address, mine are stable so I have
define('SESSION_CHECK_ADDRESS', 3); // 3 - check entire address
if your ip changes a lot, that setting wouldn't work for you, if you're on different networks a lot you may have to disable ip checking entirely (set it to 0).

OgreMHDW
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 05 May 2015, 16:35

Re: How to keep myself logged in?

Postby OgreMHDW » 26 May 2016, 23:50

I set it this morning to -1. I just got logged out. So for some reason, the cookie is being revoked even though the cookie was not expired.

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

Re: How to keep myself logged in?

Postby fox » 27 May 2016, 00:01

cookie is set to time() + specified interval in seconds, setting it to -1 would just set the cookie essentially to be a session one because timestamp will be in the past

i don't see how -1 would work any different from 0 tbh

anteatersa
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 15 Mar 2013, 00:50

Re: How to keep myself logged in?

Postby anteatersa » 27 May 2016, 12:08

Very odd, upon closer inspection I can see that my "ttrss_sid" cookie has not changed for a week now ( date or session id ) it is now successfully set for 1 year in the future but for some reason I am still logged out every morning?

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

Re: How to keep myself logged in?

Postby fox » 27 May 2016, 12:24

either your browser or your server is configured incorrectly

the possibilities are p much endless

disconn3ct
Bear Rating Trainee
Bear Rating Trainee
Posts: 37
Joined: 12 Apr 2013, 15:07

Re: How to keep myself logged in?

Postby disconn3ct » 27 May 2016, 17:13

The only cookie (or session) setting I have is:

Code: Select all

define('SESSION_COOKIE_LIFETIME', -1);


I think I see why it didn't object though, in include/sessions.php:

Code: Select all

        $session_expire = max(SESSION_COOKIE_LIFETIME, 86400);


Given how it is used I suspect I'm in some moderately undefined space, but it definitely works normally if I use the app every day or two.

On a related note, is that max() a bug? Or is there code deeper that will let me force relogin after 12 hours?

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

Re: How to keep myself logged in?

Postby fox » 27 May 2016, 18:05

i forgot about the max(), it's going to be 86400 then.

>On a related note, is that max() a bug?

dunno

>Or is there code deeper that will let me force relogin after 12 hours?

don't think so

anteatersa
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 15 Mar 2013, 00:50

Re: How to keep myself logged in?

Postby anteatersa » 03 Jun 2016, 13:02

The problem in my case was indeeed on the server.

I am running on Debian so had to edit: /etc/cron.d/php5 to stop the server deleting old php session files every 30 minutes.

This may have been fixed in newer versions of ttrss but my version which I installed sometime when Google reader went defunct does not save session data into the ttrss_sessions table in the database.

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

Re: How to keep myself logged in?

Postby fox » 03 Jun 2016, 13:20

i wanted to mention that but i assumed you wouldn't be using some paleo-version of the code without bothering to mention it because it would be massively disrespectful of people here wasting time trying to help you

i was, of course, wrong

also, i'm not sure why is this travesty of a thread in a development subforum.

anteatersa
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 15 Mar 2013, 00:50

Re: How to keep myself logged in?

Postby anteatersa » 03 Jun 2016, 13:43

Unfortunately there is no mention of release numbers or dates anywhere in the codebase which makes it a bit difficult for people to even know which version of ttrss they are running on.

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

Re: How to keep myself logged in?

Postby fox » 03 Jun 2016, 14:11

this is blatantly false

- version is displayed in preferences at the bottom
- there's include/version.php with all the necessary information in there too
- timestamps are all documented in Git which is what you're supposed to be using for the last year or so

please don't post on this forum ever again. gtfo.


Return to “Unsupported platforms”

Who is online

Users browsing this forum: No registered users and 1 guest