Page 1 of 1

Problem in Session

Posted: Wed Jun 06, 2007 9:26 pm
by bundy
Hello

I have a problem with session ...

Does the $_SESSION["username"] available throughout the website in a browser when the session start? Does it meant to be available when click on GO button of the browser as well? Coz once I clicked on the GO button in the browser, the $_SESSION["username"] become unavailable.

I hope everyone could understand what my problem was. Thank you

also What is the different with session cookie and cookie....

Posted: Wed Jun 06, 2007 9:42 pm
by feyd
Let's make sure you're painfully aware of this. General Discussion has a bold note in its description that states: This forum is not for asking programming related questions.

Posted: Wed Jun 06, 2007 9:59 pm
by bundy
feyd wrote:Let's make sure you're painfully aware of this. General Discussion has a bold note in its description that states: This forum is not for asking programming related questions.
Sorry mate didn't realize.....

Do you think you could me to answer my problem :)

Posted: Thu Jun 07, 2007 7:26 am
by feyd
This was improperly posted as a new thread
bundy wrote:I know Session in Php by default is set to be destroyed when the user's browser closed. Does that mean if there was a webpage using sessions on the page, then the user types in a same address on the address bar to access the same page, does the Sessions variable still maintain.

e.g.

address: http://www.google.co.nz?something....... having a session variable value "ABC";

then user type in the address on the address bar
like so:
http://www.google.co.nz Does the session variable value "ABC" still available;

I want to know because I testing it on the browser but don't know why the session variable's not available anymore
Two words: try it.

Posted: Thu Jun 07, 2007 4:53 pm
by RobertGonzalez
I'd bet if you searched for session with my handle as the author you'll come across the sessions test code I have posted about 10 times in the last two months. And as a general hint, make sure you are calling session_start() on every page and call it before you send any output to the browser.