Page 1 of 1

How to keep myself logged in?

Posted: 26 May 2016, 16:46
by anteatersa
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.

Re: How to keep myself logged in?

Posted: 26 May 2016, 18:14
by disconn3ct
Try -1.

Re: How to keep myself logged in?

Posted: 26 May 2016, 18:52
by fox
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

Re: How to keep myself logged in?

Posted: 26 May 2016, 19:03
by disconn3ct
-1 has been working for me.

Re: How to keep myself logged in?

Posted: 26 May 2016, 19:30
by extra808
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).

Re: How to keep myself logged in?

Posted: 26 May 2016, 23:50
by OgreMHDW
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.

Re: How to keep myself logged in?

Posted: 27 May 2016, 00:01
by fox
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

Re: How to keep myself logged in?

Posted: 27 May 2016, 12:08
by anteatersa
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?

Re: How to keep myself logged in?

Posted: 27 May 2016, 12:24
by fox
either your browser or your server is configured incorrectly

the possibilities are p much endless

Re: How to keep myself logged in?

Posted: 27 May 2016, 17:13
by disconn3ct
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?

Re: How to keep myself logged in?

Posted: 27 May 2016, 18:05
by fox
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

Re: How to keep myself logged in?

Posted: 03 Jun 2016, 13:02
by anteatersa
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.

Re: How to keep myself logged in?

Posted: 03 Jun 2016, 13:20
by fox
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.

Re: How to keep myself logged in?

Posted: 03 Jun 2016, 13:43
by anteatersa
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.

Re: How to keep myself logged in?

Posted: 03 Jun 2016, 14:11
by fox
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.