Get started with PHP-Fusion

Start a New Thread

Users Participated

  • Skeeve
    Post made: 9
  • PolarFox
    Post made: 3
  • miskith
    Post made: 3
  • Ankur
    Post made: 1
  • Rush_
    Post made: 1

  1. PHP-Fusion Support Forums
  2. PHP-Fusion 7 Support
  3. Suspected Bugs and Errors

Cookie question

If you suspect you have found a bug or a code error post here.

16 Replies 4,523 Views Last Updated on 2 years ago

Skeeve


Member

#1

Posted 4 years ago

This isn't one of those "I can't login" or "I keep getting logged out" threads.

I've looked in Search but there are quite a lot of cookie threads.

My issue is the length of time a member is logged in. Before the upgrade, I could login to my site and stay logged in for a week, and all my New Posts worked just fine. Every Monday or so, I'd have to actually click Login and New Posts worked fine.

But since upgrading, I have to login multiple times a day if I leave the site, and New Posts aren't highlighted like they should be.

I seem to remember a couple years ago that I set the length of the cookie expiration somewhere. I think. Or am I misremembering I did?

It's a pain to have to look at the post date/time to figure out if I've read a thread or not.

Thanks.
"The world is my country, and do good is my religion." - Thomas Paine

Posts: 75

Joined: 02/08/2008

PolarFox


Admin

#2

Posts: 1641

Joined: 26/08/2008

Skeeve


Member

#3

Posted 4 years ago

7.02.03
"The world is my country, and do good is my religion." - Thomas Paine

Posts: 75

Joined: 02/08/2008

PolarFox


Admin

#4

Posted 4 years ago

Maybe something wrong with time on your server/PC?

Is there any errors in admin->errors?

Posts: 1641

Joined: 26/08/2008

Skeeve


Member

#5

Posted 4 years ago

Let me rephrase my problem. I want to login and stay logged in until I actually click Logout.

It was set this way before I upgraded to the latest version. Also, my "new posts since last visit" isn't working correctly. When I log in, the new post indicator icons are showing no new posts, yet looking at the post times, I can see there are new posts.

Merged on Dec 24 2011 at 21:02:41:
Is it still considered bumping if I wait 3 months?

I still have this cookie issue. Sad
Edited by Skeeve on 25-12-2011 04:02
"The world is my country, and do good is my religion." - Thomas Paine

Posts: 75

Joined: 02/08/2008

PolarFox


Admin

#6

Posts: 1641

Joined: 26/08/2008

Skeeve


Member

#7

Posted 4 years ago

No, everything is correct. It started with the last core update. 7.02.03

I have to login each day, I'm assuming the cookie is set to 12 hours, because I can come back during the day and be logged in, but longer than that and I have to login again. Once I do log in, Threads Since Last Visit doesn't show previous posts. It only works after I have logged in and someone posts afterwards.
"The world is my country, and do good is my religion." - Thomas Paine

Posts: 75

Joined: 02/08/2008

Ankur


Admin

#8

Posted 4 years ago

Try looking it in the function includes\classes\Authenticate.class.php :
function setUserCookie($userID, $salt, $algo, $remember = false, $userCookie = true)

May be you will get some idea from there Cool
Hi! Its me, Ankur Thakur! :)

Posts: 1279

Joined: 02/11/2010

Skeeve


Member

#9

Posted 4 years ago

Code Gist: Download source  
// Set User Cookie
   public static function setUserCookie($userID, $salt, $algo, $remember = false, $userCookie = true) {

      global $_COOKIE;

      $cookiePath = COOKIE_PATH; $cookieName = COOKIE_USER;

      if ($remember) {
          $cookieExpiration = time() + 1209600; // 14 days
      } else {
          $cookieExpiration = time() + 172800; // 48 hours
      }

      if (!$userCookie) {
         $cookiePath = COOKIE_PATH."administration/";
         $cookieName = COOKIE_ADMIN;
         $cookieExpiration = time() + 3600; // 1 hour


Here?
"The world is my country, and do good is my religion." - Thomas Paine

Posts: 75

Joined: 02/08/2008

Rush_


Junior Member

#10

Posted 4 years ago

Code Gist: Download source  
 if ($remember) {
$cookieExpiration = time() + 60*60*24*365; // one year if u want)
} else {
$cookieExpiration = time() + 172800; // 48 hours
}


just use remember checkbox to stay logged in for a long time.

Posts: 32

Joined: 12/01/2011

Skeeve


Member

#11

Posted 4 years ago

thanks, i'll try that

Merged on Dec 28 2011 at 08:33:32:
Didn't help, I still have to login every morning. I always check "Remember Me". Even here, I've had to login every day I visit. Sad

Merged on Dec 30 2011 at 08:02:26:
OK, I'll try Google. I was really hoping for some support here, I've always gotten it in the past.

When I find the answer, I'll come back and post it here so you can help the next person.

smh

Merged on Jan 02 2012 at 09:10:22:
UPDATE:

So, turns out it wasn't the cookies after all.

The User Info Panel has a problem. I remembered that when I updated, I also switched back to the basic User Info Panel. Once I re-enabled the Enhanced User Info Panel and got rid of the basic version, my cookies started working correctly.

I'll assume something within the code defining the "Remember Me" is screwed up...?

Merged on Jan 16 2012 at 07:58:58:
Apparently I was mistaken. After changing the User Info panel, I was on my site quite a bit and stayed logged in. As soon as I let a day go by, I was being logged out again.

Why isn't Remember Me working?

On a side note, I have bragged about php-fusion since I first started using it, but lately the cms support has been lacking and I'm not so inclined to recommend it to others. Have you lost members who would always step up and try to find solutions to these issues or has interest in helping others waned?
Edited by Skeeve on 16-01-2012 14:58
"The world is my country, and do good is my religion." - Thomas Paine

Posts: 75

Joined: 02/08/2008

miskith


Member

#12

Posted 4 years ago

I don't know, if PHP-Fusion is using session_set_cookie_params(), but i think it isn't. And you are using SESSION? SESSION without these params has expiration time to the first browser shutdown (I don't know, how it's called in English, but in Czech it's "Na konci relace"->"At the end of session").
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)

Posts: 117

Joined: 28/07/2010

Skeeve


Member

#13

Posted 4 years ago

I don't know. I only know that Remember Me doesn't work at my site, this site and Craigs site. Angry
"The world is my country, and do good is my religion." - Thomas Paine

Posts: 75

Joined: 02/08/2008

miskith


Member

#14

Posted 4 years ago

Oh, "remember me" isn't working on this site for you? Then, check into your browser settings, if you have enabled deleting cookie(s) after browser shutdown.
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)

Posts: 117

Joined: 28/07/2010

Skeeve


Member

#15

Posted 4 years ago

Remember me works on every site I visit, except for php-fusion sites.
"The world is my country, and do good is my religion." - Thomas Paine

Posts: 75

Joined: 02/08/2008

miskith


Member

#16

Posted 4 years ago

Has your browser any cookie(s) manager? If so, could you look at expiration time after singin?
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)

Posts: 117

Joined: 28/07/2010

Skeeve


Member

#17

Posted 4 years ago

I just logged in and left the site. Here are my cookies:

atheiststoday.com/images/visitedwww.jpg
atheiststoday.com/images/visitednowww.jpg
atheiststoday.com/images/lastvisit.jpg
atheiststoday.com/images/user.jpg

Merged on May 13 2013 at 21:39:28:
This is still an issue. And it only affects php-fusion sites I visit.
Edited by Skeeve on 14-05-2013 04:39
"The world is my country, and do good is my religion." - Thomas Paine

Posts: 75

Joined: 02/08/2008

Jump to Forum:
4 users are online
0 member and 4 guests