I am working on a Admin view of an Intranet site. They need to enter orders.
An order can include many inventory items so I have divided it up to two
I have set up a first page session that passes the first page info onto the
second page where the inventory items are addes to the order. I need to be
able to add multple second pages while still maintaining the first page info
and collecting the multiple second page info and then sending all the info
to the database when the user finally clicks the finish button
Can anyone help me with this
Kevin P 's gravatar image asked Jan 3 2002 at 16:52 in Php-General by Kevin P

18 Answers

Nice day here in the UK thanks but still having major problems with
Please note that I can maintain the value of my session variables between
web pages. However, the problem I have is that I can't kill (destroy) the
session once I'm finished with it. If I issue a "session_destroy()" command
session file on the server is emptied (file size 0 bytes). However, if I
attempt to destroy the session on another page then the session file isn't
emptied and still contains the variable values. Using "session_unset" before
the "session_destroy()" command doesn't help.
I tried your example code below and it DIDN'T print the SID. Whenever and
however I tried to print SID it never returns a value. However, using
session_id() instead works fine and produces the same results as your
script. Is this a cause of concern?
Any help on killing sessions with PHP (I'm running the latest version -
binary downloaded from PHP website) will be greatly appreciated. I'm running
James Duncan 's gravatar image answered Aug 27 2000 at 14:15 by James Duncan
So what you seem to be saying is that it's up to us to physically delete the
session file? The thing that worries me is that if I issue the
session_destroy command on the same page that originally opened the session
the contents of the session file is 0 bytes. However, when I session_destroy
the same session from another page the contents of the session file remain
(i.e. variables still in there and not 0 bytes). If we are supposed to
physically destroy the session file ourselves why the differences in
operation of the destroy command?
I can't simply leave the session file to be deleted by garbage collection
because if the user returns to the page that created the session variables
they are still present and populated with old data!
Also wherever I run session_destroy it ALWAYS returns false.
Comments, answers, help, divine intervention....
James Duncan 's gravatar image answered Aug 27 2000 at 19:39 by James Duncan
Something weird is happening because session_unregister doesn't work (i.e. I
can still echo the global variable after unregister) but session_unset does
work. Still can't get the session file to 0 bytes with a session_destroy()
from another page, which is what is supposed to happen? Session_destroy()
always reports failure ;(
Thanks for the code below. Unfortunately "unlink" isn't built into my
version of PHP :( So I've had to use the following work around:
exec("cmd nul /c \"del $file\"");
This completely deletes the session file from the server. You are right in
that this only works after a "session_destroy()", so the destroy command is
doing something! Physically deleting the session file does give me a work
around but it's a rather nasty hack in my opinion. Surely
"session_destroy()" should work properly on Windows? Has anyone managed to
get it to work correctly?
James Duncan 's gravatar image answered Aug 27 2000 at 23:25 by James Duncan
A quick check of a MyODBC connection made from Access 2000 to a MySQL
database (with 5 tables open) shows as a single process in WinMySQLAdmin...
the total connections show up as 3 (including the WinMySQLAdmin connection,
I assume). Bumping that up to ten open tables and one open query increases
the connections to 5... opening 4 more queries leaves the number of
connections at 5...
Not very scientific, but I hope it helps.
Fred Woolsey
Woolsey, Fred 's gravatar image answered Oct 24 2001 at 16:28 by Woolsey, Fred
MySQL manual 7.28 SHOW Syntax
DL Neil 's gravatar image answered Oct 24 2001 at 16:52 by DL Neil
Thanks for your answer, but I need to know the names of the users currently
logged in the database.
Ing. Gustavo A. Edelstein
Tech. Mgr.
Equiplus Argentina S.A.
Visit us On Line at www.equiplus.com
Email addresses:
Operations: related: Wednesday, October 24, 2001 1:52 PM
Ing. Gustavo Edelstein 's gravatar image answered Oct 24 2001 at 17:36 by Ing. Gustavo Edelstein
Reply-Message-ID: your log files, normally found in the DATADIR, this will tell you who's
doing what and when.
database mysql
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Thunder Rain Internet Publishing
Providing Internet Solutions that work!
Tel: 1(225)686-2002
To: Ing. Gustavo Edelstein 's gravatar image answered Oct 24 2001 at 17:52 by mickalobellsouth.net To: Ing. Gustavo Edelstein
SHOW will do that as will 'mysqladmin processlist'.
Bill Adams 's gravatar image answered Oct 24 2001 at 17:55 by Bill Adams
I believe WinMySQLAdmin (if running on Windows) or the Unix/Linux/Solaris
equivalent (I assume there is one) shows in its Processes window all users
connected to the server and their associated process IDs.
Fred Woolsey
Woolsey, Fred 's gravatar image answered Oct 24 2001 at 17:59 by Woolsey, Fred
And he told you exactly where to find it. Try SHOW PROCESSLIST
Steve Meyers
Steve Meyers 's gravatar image answered Oct 24 2001 at 18:04 by Steve Meyers
By design. Try accessing $HTTP_SESSION_VARS instead. That should work. In
other words, if you were accessing a session variable by $session_var, now
use http://www.gaylenandmargie.com/
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite/
"Philip Maciver" wrote in be working any more, does anyone know why?
Gaylen Fraley 's gravatar image answered Dec 24 2001 at 15:31 by Gaylen Fraley
Hi there, make sure you aren't outputting anything to the browser prior to
sending headers ie the echos on top of page 3. When you register a session
variable you should assign it a value ie:
$mysessionvar = $whateveryouwish;
Also make sure session_start(); is at the top of every page with no space
These should help you out a little. Joe :)
lvaro muoz snchez wrote in
Joe Van Meer 's gravatar image answered Feb 2 2002 at 21:43 by Joe Van Meer
Try to config in php.ini file the session_save_path to C:\temp not /tmp
"Peter Finch" escreveu na
Ernani Joppert Pontes Martins 's gravatar image answered Sep 18 2002 at 05:56 by Ernani Joppert Pontes Martins
instead of using the session_register try $_SESSTION[' ssun']
"Steve Vernon" wrote in
Jeff Bluemel 's gravatar image answered Oct 6 2002 at 02:11 by Jeff Bluemel
use absolute path like including the last slash in php.ini:
Uttam 's gravatar image answered Oct 12 2002 at 11:57 by Uttam
Thanks to all who posted.
Well, I managed to track down the problem. The PHP system was set to use
/tmp for its session.save_path but there was no /tmp directiory.
Strange because on my test site I don't have a /tmp directory... I'm
guessing my ISP has taken care of that separately.
Anyway I created a tmp folder and everything seems fine.
Thanks again.
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003
Dave Alger 's gravatar image answered Jul 9 2003 at 11:59 by Dave Alger
(Webmaster) wrote
Do you set them manual, does the server auto start a session?
What are the settings for session in your ino file?
Paul van Schayck 's gravatar image answered Oct 7 2003 at 13:31 by Paul van Schayck
Greetings, "Tom Shaw".
In reply to Your message dated Sunday, September 14, 2008, 20:03:13,
I'd say, 99%. There are some technical issues included, which critical in
understanding session mechanics and debugging any causes.
Small cookie WOULD BE SET, when you complete transaction (means, when user
receive your page).
As other mentioned already, PHP sessions stored on disk by default.
Pure truth.
As a sidenote, sessions different from cookies in the next way:
You can access cookies only on the next request, but you can access session
variables immediately after you set them.
Sincerely Yours, ANR Daemon
ANR Daemon 's gravatar image answered Sep 15 2008 at 16:03 by ANR Daemon