Session in PHP

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
nithinkk
Forum Commoner
Posts: 55
Joined: Sat Nov 28, 2009 7:57 am

Session in PHP

Post by nithinkk »

I have a login system which has lots of session variables.....if a user signout the session variables will destroy.What if the user close the browser without signout. Will the session variable still there in server ??? how long it will be there ??? how to set the session expiry time when declaring the session variable ???

My session variable is like this :


session_register("mysessionvariable");
$id = session_id();
$_SESSION['login']="True";

$_SESSION['loginuser']=$authenticUser;


can anyone put some light on it ???
iamngk
Forum Commoner
Posts: 50
Joined: Mon Jun 29, 2009 2:20 am

Re: Session in PHP

Post by iamngk »

If you close the browser, session will be destroyed automatically i.e. session will not available for no more.
nithinkk
Forum Commoner
Posts: 55
Joined: Sat Nov 28, 2009 7:57 am

Re: Session in PHP

Post by nithinkk »

No session will not destroy automatically if the browser closes bcoz its stored in server....
Sonia ferdous
Forum Newbie
Posts: 1
Joined: Fri Jan 29, 2010 4:10 am

Re: Session in PHP

Post by Sonia ferdous »

session must be destroy....
nithinkk
Forum Commoner
Posts: 55
Joined: Sat Nov 28, 2009 7:57 am

Re: Session in PHP

Post by nithinkk »

im sure that it will not get destroy.....
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Session in PHP

Post by klevis miho »

When you close the browser the session variable will be destroyed. If you don't want that, use cookies.
nithinkk
Forum Commoner
Posts: 55
Joined: Sat Nov 28, 2009 7:57 am

Re: Session in PHP

Post by nithinkk »

when a browser closes without sign out and some one else access the same page we can able to get in without signout....
nithinkk
Forum Commoner
Posts: 55
Joined: Sat Nov 28, 2009 7:57 am

Re: Session in PHP

Post by nithinkk »

ohhh...god no one can clear my doubt .....????
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Session in PHP

Post by Christopher »

Please do not double post. Sometimes you will not get an answer.

See the manual about PHP's configuration setting for the session:

http://www.php.net/manual/en/session.co ... ni.session
(#10850)
Post Reply