Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
LOGOUT_COOKIE issue
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2025-11-15 19:12:26
When you change password it throws this error...

Quote:
Password Changed OK, You will now need to re-login

Warning: session_start(): Cannot start session when headers already sent in /var/www//backend/functions.php on line 634


The line number is from your site

I get same error on my site, but different line of course.

As the error states, the password does change, but the error is annoying, among other things.
Last edited by MicroMonkey on 2025-11-21 11:45:45
2025-11-15 19:22:16
Did you follow the instructions I wrote in the post and did you add the PHPMailer folder?

PS: I dont understend you. What(where) is the problem.
On your site  or micromonkey site???????????????
Last edited by coco on 2025-11-15 19:25:15
2025-11-15 22:11:29
The problem is in the functions.php file, specifically the LOGOUT  COOKIE function.
I am using the same function that is on MM's github...the most recent.
His test site is apparently using same function, as his site throws the same error when you change password.
The error is as follows...


Quote:
Password Changed OK, You will now need to re-login

Warning: session_start(): Cannot start session when headers already sent in /var/www//backend/functions.php on line 634



And, email is not an issue and is not involved in changing your password.
Last edited by MicroMonkey on 2025-11-22 17:54:11
2025-11-15 22:55:29
Give us the part of the code you're having trouble with?
This way we can't help you without knowing what we're dealing with...

This is my part of cokie code in functions.php


function logincookie($id, $password, $secret, $remember = false, $updatedb = 1, $expires = 0x7fffffff) {
//if ( !$remember ) $expires = null;//
$hash = sha1($id.$secret.$password.getip().$secret);
setcookie("pass", $hash, $expires, "/");
setcookie("uid", $id, $expires, "/");
if ($updatedb)
SQL_Query_exec("UPDATE users SET last_login = '".get_date_time()."' WHERE id = $id");
}

function logoutcookie() {
setcookie("pass", null, time(), "/");
setcookie("uid", null, time(), "/");
}



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2025-11-15 22:56:30
2025-11-16 03:31:10
hmm. It does that on my site too? I checked and I did make a few edits. I guess they were incorrect. This is the original.
function logincookie($id, $password, $secret, $updatedb = 1, $expires = 0x7fffffff) {
$hash = sha1($id.$secret.$password.getip().$secret);
setcookie("pass", $hash, $expires, "/");
setcookie("uid", $id, $expires, "/");

if ($updatedb)
SQL_Query_exec("UPDATE users SET last_login = '".get_date_time()."' WHERE id = $id");
}

function logoutcookie() {
setcookie("pass", null, time(), "/");
setcookie("uid", null, time(), "/");
}

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2025-11-16 03:49:42
2025-11-16 03:48:18
Yes, and it give same error as on mine...different line number, but same content.
I'm using same lines from your github.
Last edited by Obiwan on 2025-11-16 03:50:11
2025-11-16 03:59:39
Replace the code with the original. its commented, and see if that does anything.
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2025-11-17 04:33:38
That was one of the first things I tried, but still the same.

Guess will probably have to live with it...it doesn't affect ability to change the password, and the new password works fine.
2025-11-22 16:41:30
does this work?  
function logoutcookie() {
   if (session_status() === PHP_SESSION_ACTIVE) {
       $_SESSION = [];
       session_unset();
       session_destroy();
       session_write_close();
   }
   $params = session_get_cookie_params();
   setcookie(session_name(), '', time() - 3600, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
   foreach (['pass', 'uid'] as $cookie) {
       setcookie($cookie, '', time() - 3600, $params['path'], $params['domain'], true, true);
   }
   return true;
}

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2025-11-23 13:20:21
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728