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

Related Discussions

  • [PHP]Sessions... in Php-general

  • Hello, i'd like to ask of all of you - has anybody had the same problem like me... My problem - keeping session variables when i open another window from "parent" window (by pressing shift and opening child "window"), or opening the same window by pressing CTRL+N My problem is - how to know, that these variables must be unset when it happens ? Thanks (from Lithuania :-))...

  • [PHP] SESSIONS in Php-general

  • Dear List - My session variables do not seem to propagate.... a.php global $cxn; global $sale; global $tax_rate; global $tax; $upc = $_POST['UPC']; $_SESSION['UPC'] = $_POST['UPC']; case 'step3': { echo 'step3'; global $cxn; ...

  • Sessions In Php 4.0.3pl1 in Php-general

  • Has anyone had problems with $SESSION not functioning in the current release? All sessions that worked under 4.0.2 have stopped working... I'd appreciate any help resolving this a quickly as possible. Regards, Jack...

  • PHP Sessions in Php-general

  • Hi, After a day and a half of pounding my head against the wall I believe I've identified the source of the problem. When I create and register the session in my login page - it does not carry forward to any other pages. I've found this by going through several different tutorials for making password protected areas using PHP and Sessions that I've found both attitude - yet all work...

  • Php Sessions in Php-general

  • Hello, i'm using sessions in my application but i found something strange. when creating new session: define('S_USER', 0); define('S_USER_ID', 0); define('S_USER_NAME', 1); session_start(); $_SESSION[S_USER][S_USER_ID] = 1; $_SESSION[S_USER][S_USER_NAME] = 'Michal'; when redirect on next page - session is empty but when a change first define to: define('S_USER', 'user'); everything...

  • Php - Sessions in Php-general

  • Hi! I'm running PHP 4.01 on my linux server. When I try to run php-sessions on it, it creates session files in the /tmp directory as it should. But the problem seems to be that it doesnt put anything into the files. The sessions won't work. If this is a known bug, I'll upgrade my php. If not does anyone know what I might have misconfigured (or otherwise done wrong)? Geir Berset...

  • PHP Sessions in Php-general

  • hi! What should i do to get the status of a session, i mean, if a session was already started or the user that entered the page doesnt have a session registered? Excuse my english.. Joe....

  • PHP And Sessions? in Php-general

  • Hi, I've created a password protected area on the site I'm working on using PHP Sessions - I've done this several times before without any difficulty. This time, I've copied my old code - made the necessary changes for login/passwd/database names, yet the sessions don't appear to be working. I've been comparing the PHP settings on each server - the server that works is using 4.2.2...

  • PHP 4.3 Sessions in Php-general

  • Hello, i recently migrated to the version 4.3.1 of PHP. I used The PHP::Session module to access PHP files from Perl. But since i migrated, the session expired even if i use the perl section of the site. Does anything change in the PHP sessions and how can i get the module work?? Thanks Paddy...

  • Php Sessions Limit in Php-general

  • Hi This may sound strange. but ... Is there a limit to the number of sessions one can/should have using the same identity details at one time. ie if beta testing a website with the same password details etc. or is it irrelevant. Thanks Andrew...

  • [PHP] Cookieless Sessions in Php-general

  • I'm trying to maintain sessions without cookies using SID. all works fine if I click on links which have the variable embedded, like...

  • PHP Sessions Expiring Early in Php-general

  • I'm having trouble with a PHP website which requires users to be logged in to access all content other than the home page and a couple of static pages (about us, contact us etc.). Several users have said they are being logged out every few minutes whilst using the site - they can login but will be shown the login form again after a few minutes. I can't confirm this myself as the site seems...

  • [PHP] Sessions And Arrays in Php-general

  • Hello Everyone, How do I send a single array, with many values, through sessions? For example, I might have the following: By registering just the "product" array, will I have all of the values of that array available to me throughout the entire session? Or will I have to register each array variable-value pair separately, like so: session_register("product['category']", "product['...

  • PHP Sessions And Cookies in Php-general

  • I have a couple of questions regarding sessions and cookies: 1) Is there a way to append information to a cookie? I have read that it is, but I have also read many problems. Is there any particular way to do this? I ask this because cookies are being generated by two different types of scripts. However, they are both on the same site. So, I have access to them, no problem. I just...

  • PHP SESSIONS And FRAMES in Php-general

  • I have a shopping cart with affiliate sales support. What's happening is that some affiliates are using frames to use their domain while using our shopping cart. So they are using a frameset like this: The problem I'm having is that sessions are not being passed properly or are expiring. Anybody experience this kind of problem? If so can you provide any advice on passing...

  • PHP Sessions in Php-general

  • Hi All, I have a login page that which verifies he username & password against a MySql database and then passes the username to another page as a session. I created this on my PC, which is running PHP version 4.3.2, and it works with no problem. My host has the following set on the server which is running PHP Version 4.3.3: 1. register_globals set to off, 2. Session.bug_compa4_42 set...

  • Php Sessions... in Php-general

  • hey a quick question/clarification... i have the following... later in the code i want to use the session var... my question... how/what do i need to use the $foo var. I was under the impression that $foo was automatically available when declaring the session var... do i need to use session_register('foo')? if i do, why... wouldn't the "foo" session var already be registered with $_SESSION...

  • PHP Sessions in Php-general

  • Hi: I need to store variables to send then between pages. I don't need the variables in a database so I try to send them with sessions. The variables don't seem to be there when I try to get them. What could be the problem. Here are the pages where I store and retrieve the variables. Page 1 (variables stored): Page 2 (variables retrieved):...

  • [PHP] Sessions in Php-general

  • Hello everyone, Simple question: Will registering a variable twice, using session_register(), reset the value of the variable to a different value? I just now started using the session_is_registered() function on all sessions to see if they have been registered already, before I register them yet again. But now I'm wondering about the inner workings of the session itself. PHP.net doesn'...

  • Php Sessions in Php-general

  • Hi I have a problem. I can't send the session_id to the next page. It worked before (when I had an old version of php, now I have 4.2.0). It can send the session_id() if it's a link, but not a header(). If it is a header I have to do this: define('MYSID', session_name().'='.session_id()); header('Location: ../index.php?'.zOLSID); Do I have to add this to every header()? Or is there a ...