Page 1 of 1

More session handling questions

Posted: Wed Oct 13, 2004 6:37 pm
by umcookeg
Hi

Do you need to have cookies enabled in order to use php sessions. I was under the impression that session data is stored server side and that users do not need to have cookies enabled is this true?
Today I was working at work, working in my site and everything was working fine. I was able to move through the site no problem in a browser with cookies disabled and cache set to 0.

Note: The web server is also on my machine used for testing.

I get home today want to work on the site and I can't log in because I don't have cookies enabled. Now I haven't touched my code at all I just wanted to see if I could use it from home.

So I am guessing that since I was using the site from the web server perhaps that is why everything was fine could this be true?

What can I do, besides URL re-writing, to allow users without cookies enabled to get access to my site?

Dave

Posted: Wed Oct 13, 2004 7:04 pm
by John Cartwright
Do you need to have cookies enabled in order to use php sessions
Nope.

re sessions

Posted: Wed Oct 13, 2004 7:38 pm
by umcookeg
if not then why am I getting this

Code: Select all

suv: Object
Survey object is set in the session variable suv
The usrs current question number will be:

Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition <b>survey</b> of the object you are trying to operate on was loaded _before_ the session was started in /srv/www/htdocs/Survey/processTrans.php on line 50
I only seem to get this after I have enabled

Code: Select all

session.use_trans_sid to 1
After I do this am I supposed to take out all my session-start functions at the top
of all my pages?

This afternoon I was working on this at work with cookies disabled on my browser the above configuration was set to 0 and I had no problems working
through the survey. I get home disable cookies on one of my browsers and I can't get into the site because it isn't maintaining my session data. So I get
kicked out. So I tried to enable the above configuration in php.ini and I
I get a nasty gram.

My computer at work that I was working on has the web server on it, I am using it for testing. Could that be why it worked at work but not at home?

Hellllp


PS I just wish the users that were going to go through the survey were allowed to use cookies.

Posted: Thu Oct 14, 2004 3:33 am
by timvw
in every script where u want to get an object out the session, you need to include/require the class definition of that object.

if i remember well, you have to (un)serialize objects if you store/retrieve in a $_SESSION