Wrox Programmer Forums
|
BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
This is the forum to discuss the Wrox book PHP and MySQL: Create-Modify-Reuse by Timothy Boronczyk, Martin E. Psinas; ISBN: 9780470192429
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2011, 07:45 PM
Registered User
 
Join Date: Jun 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Question Ch.1 Logoff Not Clearing Session Data

Let me start by saying I am not an adept PHP programmer. I am more of noodle it through, cut and paste artist. I have worked my way through the first chapter and have most things working. The thing that concerns me most is that the Logoff function doesn't seem to be properly clearing the user data for the session. I am able to browse directly to the main.php after logoff and see the Username and email of the last logged in user. Can anyone direct me in correcting this problem?
 
Old June 7th, 2011, 06:01 PM
Authorized User
 
Join Date: May 2011
Posts: 12
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Hi Tenuous,

Try this

1. Rename file main.php to editmember.php
2. Create new file called main.php and include the following code below: (Important: notice that the html link sends a variable called "logout". In my book it refers to logoff in the text although the download code uses logout"

Code:
<?php
// include shared code
include '../lib/common.php';
include '../lib/db.php';
include '../lib/functions.php';
include '../lib/User.php';
//include '401.php' to successfully logOUT!
include '401.php';
?>

<a href="login.php?logout">LOG OUT</a>
I'm happy with it. I think it is what they are trying to show us; but if you find anything wrong, let me know, then I will have to change things.

Regards

Last edited by Albion; June 7th, 2011 at 06:03 PM..
The Following User Says Thank You to Albion For This Useful Post:
Tenuous (June 11th, 2011)
 
Old June 11th, 2011, 02:55 PM
Registered User
 
Join Date: Jun 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Albion View Post
Hi Tenuous,
*snip*
(Important: notice that the html link sends a variable called "logout". In my book it refers to logoff in the text although the download code uses logout"
*snip*
After further review, this was my problem... I was using logoff and the code was expecting logout. As soon as I changed it, everything worked well.

Thanks for your response!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined session variables Ch.2 pg. 38-39 outtaMyBlood BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 2 March 14th, 2009 02:19 PM
Trace logoff error l.wolf Oracle 0 June 7th, 2007 05:10 AM
Auto logout by clearing session variable BananaJim Classic ASP Professional 5 April 4th, 2007 01:43 AM
Logoff User Help ali786 Classic ASP Databases 1 March 31st, 2005 01:27 PM
Professional PHP5 Ch. 15 Custom Session Handler superrobotpope Pro PHP 4 February 4th, 2005 08:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.