Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning 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
 
Old February 19th, 2006, 01:25 PM
Registered User
 
Join Date: Feb 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default HUGE TIMESAVER - CH. 2 SESSIONS -

Working on the first "Passing the Visitor's Username". Using Windows XP, kept getting "headers already sent" warning when viewing movie1.php.

What worked for me:

1. Created the c:\tmp directory (I don't know if this is still necessary)

2. Located php.ini file in c:\windows

3. Changed "session.auto_start = 0" to " = 1"

4. Saved the php.ini file

5. Deleted session cookie in my browser, closed browser

6. Restarted Apache (to get the changed php.ini info)

7. Voila! success ... hope this saves someone 24 hair pulling hours

Here is the background for those of you who are readers.

Kept getting the "headers already sent" Warning. I found this valuable insight at

http://phpbuilder.com/manual/en/ref....sion.save-path

Note: Prior to PHP 4.3.6, Windows users had to change this variable in order to use PHP's session functions. A valid path must be specified, e.g.: c:/temp.

In other words, you don't have to specify a path for session.save_path in your php.ini file.

What you DO have to do though, is to is to set session.auto_start

; Initialize session on request startup.
session.auto_start = 1

The default setting is session.auto_start = 0.

I found another post saying changing session.cookie_path -

; The path for which the cookie is valid.
session.cookie_path = /

to "session.cookie_path = \" worked for them.

It works with the default setting. Don't waste your time on that one.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch. 2 - Passing Variables with Sessions tks001 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 February 20th, 2006 07:26 PM
HUGE Log Files - Help?!? MAtkins SQL Server 2000 4 August 30th, 2005 03:13 PM
Loading huge text files zoostar Java GUI 0 June 13th, 2005 04:08 PM
Mixing classic ASP sessions with ASP.NET sessions scorpion_king General .NET 2 August 4th, 2004 08:20 AM





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