Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
| Search | Today's Posts | Mark Forums Read
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP 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
  #1 (permalink)  
Old July 31st, 2003, 08:36 AM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Custom session handling

when I tri to use handler.php (from Pro PHP4 chapter 8)
I get the following error [Thu Jul 31 15:30:48 2003] [error] PHP Fatal error: session_start() [<a href='http://www.php.net/function.session-start'>function.session-start</a>]: Failed to initialize session module in handler.php on line 8
My session.save_handler is set to user and magic_quotes_gpc is et to on.

Can anybody help me with this ?

Thanks
  #2 (permalink)  
Old July 31st, 2003, 02:23 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay, you set your session save handler to user... did you actually write custom session handling functions? If so, did you register them as the session handlers?

Basically, you told PHP that you, the user, would provide the functions that handle opening, closing, reading, writing, and deleting session data. If PHP is NOT told which custom user-defined functions will perform the above session data maintenance tasks, then it cannot, obviously, start a session -- from where will it retrieve the session data? To where will PHP store the data?

I could give you a big overview on sessions, but there's already a lot of info posted about it. Read the articles on custom session handlers for PHP4 on PHPBuilder. They're dated, but they should give you a pretty good idea for what to do.


Take care,

Nik
http://www.bigaction.org/
  #3 (permalink)  
Old July 31st, 2003, 02:23 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One more thing -- if you want to just get started with sessions, change your session handler from "user" to "files" and let PHP manage all your session data maintenance automatically.


Take care,

Nik
http://www.bigaction.org/


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom HTTP Error Handling windows_mss ASP.NET 1.0 and 1.1 Professional 0 March 14th, 2007 02:44 AM
Exception handling in a custom control flegel ASP.NET 2.0 Professional 0 February 20th, 2007 10:26 AM
Session Parameter with Custom Object tna55 ASP.NET 2.0 Basics 8 February 6th, 2007 09:57 AM
session handling meenakshi.sharma84@gmail. PHP How-To 1 April 12th, 2006 03:08 AM
Session Handling sam PHP How-To 1 June 19th, 2003 03:10 PM





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