Logging Out Issue

  • HollyHunter
  • Newbie
  • Newbie
  • User avatar
  • Posts: 13

Post 3+ Months Ago

Hi All

I have a script that integrates PunBB with a social networking script i'm using, the integration works fine and when a user logs into my social script, they get logged into the forum as well, good stuff.

The problem i've got is that after about a day or so they seem to get automatically logged out of the PunBB forums and remain logged into the social script, which means people are going to have to log into forum everytime they visit which is quite silly.

Now i'll bet 10p that the integration script i'm using is setting some kind of time for them to remain logged into the forum, there doesn't appear to be any other explanation.

Could someone who understands php have a look at the script for me and tell me if this is the case, and also how i remove that function so they remain logged in until they log out?

I've uploaded the code here: *** Problem Solved ****

The cookie functions are near the end with the log in / out info...

Thanks to anyone who can help! xx
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

Here's your issue:

Code: [ Select ]
$timedata = time () + 86400;
{code condensed for readability}
setcookie ($$cookiename, base64_encode ($user_id . '|' . $hvalue . '|' . $timedata . '|' . sha1 ($salt . $hvalue . pun_hash ($timedata, $salt))), $timedata, $$cookiepath, $$cookiedomain, $$cookiesecure, true);
  1. $timedata = time () + 86400;
  2. {code condensed for readability}
  3. setcookie ($$cookiename, base64_encode ($user_id . '|' . $hvalue . '|' . $timedata . '|' . sha1 ($salt . $hvalue . pun_hash ($timedata, $salt))), $timedata, $$cookiepath, $$cookiedomain, $$cookiesecure, true);


You're setting an expiration on the cookie for 24 hours after login.


You can't set a cookie that doesn't expire, but you can set one for some time in the future. Change line 244 (that's the pastebin number) to this:

Code: [ Select ]
$timedata = time() + 60*60*24*7*365; //expires in one year
  • HollyHunter
  • Newbie
  • Newbie
  • User avatar
  • Posts: 13

Post 3+ Months Ago

Thanks UPSGuy, I'll give that a go :)

Holly xx

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 87 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.