Wrox Programmer Forums
|
BOOK: Professional PHP6
This is the forum to discuss the Wrox book Professional PHP6 by Edward Lecky-Thompson, Steven Nowicki; ISBN: 9780470395097
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional PHP6 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 January 3rd, 2010, 10:48 PM
Registered User
 
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question HTTPSession Question

It says on page 298 that I should be getting the same output every time I refresh the page, but the session id changes EVERY TIME. The only changes I made to the code is PgSQL to MySQL and switching _session_close_method() to public to get rid of the error. Any ideas what happened? Thanks in advanced!
 
Old January 4th, 2010, 10:55 AM
Registered User
 
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Found Out What Was Wrong!

Never mind. I found out what was wrong. The $strUserAgent variable in the HTTPSession Class was in the wrong spot. The wrong version of the SQL in the __construct function:

PHP Code:
$stmt "...AND ((now() - `created`) < '" $strUserAgent $this->session_lifespan " seconds') AND `user_agent` = '" "' AND..." 
And now look at the right SQL:

PHP Code:
$stmt "...AND ((now() - `created`) < '" $this->session_lifespan " seconds') AND `user_agent` = '" $strUserAgent "' AND..." 
Notice how the ' . $strUserAgent' moved. Is was in the complete wrong area.

To Ed L.-T., Steven D. N., and/or Thomas M.: You should consider updating the Code for Download so this will work for future downloaders.

Thanks!
 
Old March 1st, 2011, 05:45 PM
Authorized User
 
Join Date: Jun 2010
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by php_person View Post
Never mind. I found out what was wrong. The $strUserAgent variable in the HTTPSession Class was in the wrong spot. The wrong version of the SQL in the __construct function:

PHP Code:
$stmt "...AND ((now() - `created`) < '" $strUserAgent $this->session_lifespan " seconds') AND `user_agent` = '" "' AND..." 
And now look at the right SQL:

PHP Code:
$stmt "...AND ((now() - `created`) < '" $this->session_lifespan " seconds') AND `user_agent` = '" $strUserAgent "' AND..." 
Notice how the ' . $strUserAgent' moved. Is was in the complete wrong area.

To Ed L.-T., Steven D. N., and/or Thomas M.: You should consider updating the Code for Download so this will work for future downloaders.

Thanks!
very useful! thanks!!! :-):-):-)
 
Old February 9th, 2012, 07:34 AM
Registered User
 
Join Date: Jan 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks php_person

Quote:
Originally Posted by php_person View Post
Never mind. I found out what was wrong. The $strUserAgent variable in the HTTPSession Class was in the wrong spot. The wrong version of the SQL in the __construct function:

PHP Code:
$stmt "...AND ((now() - `created`) < '" $strUserAgent $this->session_lifespan " seconds') AND `user_agent` = '" "' AND..." 

And now look at the right SQL:

PHP Code:
$stmt "...AND ((now() - `created`) < '" $this->session_lifespan " seconds') AND `user_agent` = '" $strUserAgent "' AND..." 
Notice how the ' . $strUserAgent' moved. Is was in the complete wrong area.

To Ed L.-T., Steven D. N., and/or Thomas M.: You should consider updating the Code for Download so this will work for future downloaders.

Thanks! [:D]

I'd have wasted a lot more time if I hadn't found your post!! thanks again.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Disappearing UserName & Question within Customized PasswordRecovery Question Template eddiemcham ASP.NET 3.5 Basics 13 June 13th, 2009 04:23 AM
HttpSession What is and How to? sandip.bhoi VS.NET 2002/2003 3 October 4th, 2007 11:46 AM
HttpSession and HttpSessionState praveenthonda ASP.NET 2.0 Professional 1 September 5th, 2007 04:33 PM
Question Ashwini Classic ASP Databases 2 January 5th, 2006 01:31 PM





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