Problem in Session

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bundy
Forum Newbie
Posts: 15
Joined: Mon Jun 04, 2007 7:04 pm

Problem in Session

Post 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....
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
bundy
Forum Newbie
Posts: 15
Joined: Mon Jun 04, 2007 7:04 pm

Post 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 :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
Post Reply