30, August 2008

Logout with example1.php does not work - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  Php User Class
Topic: Logout with example1.php does not work
« previous next »
Pages: [1] Print

Author Topic: Logout with example1.php does not work  (Read 761 times)
I crack Photoshop!
*
Posts: 3
22 credits
Members referred : 0


« on: Feb 25, 2008, 11:39:58 AM »

Hi all,

I'm testing phpUserClass. I've set up the db-table and made the changes in access.class.php
Then I created an account with example2.php
Afterwards I logged in at example1.php
All works well.
But when I now try to logout nothing happens.

Is this a known prob? What could be my mistake?
Is it a problem with the cookie? I didn't check the "remember me" box.

Thanks a lot,
Tobi
I crack Photoshop!
*
Posts: 3
22 credits
Members referred : 0


« Reply #1 on: Feb 25, 2008, 11:47:44 AM »

To answer myself Grin

changed: var $remTime = 2592000;//One month
to: var $remTime = 1;//2592000;//One month

That was, why the logut failed. Don't know if this was ok Grin

Best regards,
DerTobi
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8029
41131 credits
Members referred : 3



« Reply #2 on: Feb 25, 2008, 01:56:48 PM »

Hi DerTobi,

Are you using the latest version of the class? (0.91)

We have fixed that problem in the previous release.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
I crack Photoshop!
*
Posts: 3
22 credits
Members referred : 0


« Reply #3 on: Feb 26, 2008, 01:53:39 PM »

Hi Nikolas,
yes I'm using 0.91 (@version $Id: access.class.php,v 0.91 2007/11/09 10:54:32) and I see, that the problem still occurs, when I tell example1.php to "Remember me?". Then I cant "logout" again, until I delete the cookie in my browser for my own.

My php -v is:
Code:
PHP 5.2.5-0.dotdeb.0 with Suhosin-Patch 0.9.6.2 (cli) (built: Nov 12 2007 19:09:20)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

My phpinfo() is:
http://www.rpg-community.net/phpUserClass/example1.php Visit through proxy

Best regards,
DerTobi
« Last Edit: Feb 26, 2008, 02:56:58 PM by dobberph »
I crack Photoshop!
*
Posts: 3
18 credits
Members referred : 0


« Reply #4 on: May 25, 2008, 07:52:17 PM »

Hi DerTobi,

Are you using the latest version of the class? (0.91)

We have fixed that problem in the previous release.

I'm having this problem as well, using v0.93. I made the change that dobberph mentions above, which makes the logout link work, but then the login isn't remembered (despite me ticking that option) when I restart my browser. Any ideas?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8029
41131 credits
Members referred : 3



« Reply #5 on: May 26, 2008, 01:03:25 AM »

I will check it tomorrow and let you know. It works fine with me do I will have to check on the php settings. Matt can you send me a link to your phpifo?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
I crack Photoshop!
*
Posts: 3
18 credits
Members referred : 0


« Reply #6 on: May 26, 2008, 01:16:00 AM »

Thanks Nikolas. My phpinfo is here: http://threechords.org/dev/info.php Visit through proxy
I crack Photoshop!
*
Posts: 3
18 credits
Members referred : 0


« Reply #7 on: May 28, 2008, 12:01:53 AM »

I managed to get it to work, first by adding my domain to the setting var $remCookieDomain, and then by changing this line in "function logout($redirectTo = '')" like this: (added slash and domain)

setcookie($this->remCookieName, '', time()-3600, "/", 'mysite.com');

I also changed this code back (as mentioned above) so I stay logged in:
var $remTime = 1;//2592000;//One month
to: var $remTime = 2592000;//One month


I crack Photoshop!
*
Posts: 3
18 credits
Members referred : 0


« Reply #8 on: Jul 29, 2008, 12:15:20 AM »

I only add "/" as parameter and it works Smiley

original:
Code:
  function logout($redirectTo = '')
  {
    setcookie($this->remCookieName, '', time()-3600);

new:
Code:
  function logout($redirectTo = '')
  {
    setcookie($this->remCookieName, '', time()-3600, "/");

is it a good solution to add this parameter hardcoded?
« Last Edit: Jul 29, 2008, 12:25:03 AM by Johnny »
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7611
Tags : example1.php example1 Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  Php User Class
Topic: Logout with example1.php does not work
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Aug 30, 2008, 12:54:01 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.176
Total Topics: 7.461
Total Members: 3.861
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: matsolof

34 Guests, 4 Users online :

17 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.