Author Topic: custom logout  (Read 4235 times)

0 Members and 1 Guest are viewing this topic.

Offline fabio

  • Newbie
  • *
  • Posts: 36
    • View Profile
custom logout
« on: January 17, 2006, 12:27:09 PM »
hello

i need to logout the users from a page outside 4images so i can`t use the logout() function

i reset the cookies

Code: [Select]
setcookie('4images_userid', '-1', -3600 ,'/' );
 setcookie('4images_userpass', GUEST ,-3600 ,'/');

and delete the user from the session table

i`ve checked both cookies and the db and the actions have the result i want
but the user remains logged in.

what else should i do ?


thanks

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: custom logout
« Reply #1 on: January 17, 2006, 02:38:21 PM »
If you reset cookies and remove session from the database, then ths should do the trick...
If possible I'd like to test it ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline fabio

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: custom logout
« Reply #2 on: January 17, 2006, 02:46:19 PM »
i can`t find why but it didn`t work
i can`t give you a link cause i`m doing this on my local test server


i found a work around
i made a copy of logout.php  and modified it a little
Code: [Select]
$main_template = 0;

$nozip = 1;
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');

$site_sess->logout($user_info['user_id']);
header("Location: http://localhost/mainsite/index.php");



Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: custom logout
« Reply #3 on: January 17, 2006, 03:02:34 PM »
oh, ok.
Just let you know, you also could try do it without modifying logout.php by using link like this:
Quote
4images/logout.php?url=http://localhost/mainsite/index.php
it should redirect to the url you specifyed ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline fabio

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: custom logout
« Reply #4 on: January 18, 2006, 09:05:06 AM »
that`s better solution... i`ll try this one