Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional PHP6
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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!
  #2 (permalink)  
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!
  #3 (permalink)  
Old March 1st, 2011, 05:45 PM
Authorized User
Points: 152, Level: 3
Points: 152, Level: 3 Points: 152, Level: 3 Points: 152, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2010
Location: Bra - Italy
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!!! :-):-):-)
  #4 (permalink)  
Old February 9th, 2012, 07:34 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.