Topic awaiting preservation: Problems with session |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: New Jersey, USA |
posted 07-31-2003 11:38
I am working on a little site and am trying to use PHP's session to pass back errors as well as the data entered, but am running into problems. It seems that I can set a session value using |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 07-31-2003 12:10
Rhino: Welcome. You have bits of your code there so I'm not sure where the problem is sneaking in but have you started the session? It may be that your Windows server is set to automaticall start sessions while your web server isn't. Anyway there are problem a few places were problems can sneak in - have a look through TP's guide: |
Paranoid (IV) Inmate From: Sthlm, Sweden |
posted 07-31-2003 12:11
The first you should check is if you have this line |
Bipolar (III) Inmate From: New Jersey, USA |
posted 07-31-2003 12:51
Sorry I didn't include more code.. Here is an example where I am allowing the person to edit an entry. I am loading up an array called $portfolio and setting it to Session (atleast I think). |
Paranoid (IV) Inmate From: Sthlm, Sweden |
posted 07-31-2003 17:40
One of the easiest ways to see what content you have and how it is structured in the session is to drop this in the head of the page: code: print("Session:<pre>");
|
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 07-31-2003 18:11
Rhino: Yep - follow DmS' advice - that is one of the most useful tricks I've found yet. It makes trouble shooting tricky things like arrays much simpler (thanks again for sharing ). |
Paranoid (IV) Inmate From: Den Haag, Netherlands |
posted 07-31-2003 18:39
from http://www.php.net ... quote: |
Bipolar (III) Inmate From: New Jersey, USA |
posted 07-31-2003 19:29
I ended up taking trib's suggestion and giving it a try since I was able to store the ID in session. So, I removed everything from the array and am storing only Simple scalar values into Session. AND IT WORKED! Yahoo. |
Paranoid (IV) Inmate From: Sthlm, Sweden |
posted 07-31-2003 22:59
Well, I'd have to disagree on that one (no arrays in the session) |
Bipolar (III) Inmate From: New Jersey, USA |
posted 07-31-2003 23:09
What type of platform are you running this on? I had complete success storing arrays in Session when developing on a Windows platform, but when I finally deployed it onto a Linux server it no longer maintained the arrays and alot of functionality disappeared. So, I am back to the Name/Values in Session. Can you include more code snippets so we can see how you are doing it and please let us know what the platform you are running this on. |
Paranoid (IV) Inmate From: Sthlm, Sweden |
posted 08-01-2003 10:24
We are developing on win2k or XP with phpdev as a basic developing platform (slightly modded to fit the clients platform) running Apache 1.3.27 PHP 4.2.1 and MySQL 3.23.34 code: function getRegions()
|
Paranoid (IV) Inmate From: Den Haag, Netherlands |
posted 08-10-2003 10:55
Thanks DMS - interesting information. I've stored it in my "Things Trib should know" braincells ... |