Session does not end after closing/opening browser?
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Session does not end after closing/opening browser?
This isn't very important though I noticed when I started a session, closed Firefox, opened Firefox back up, and the page loaded that I was still signed in with the session. I thought sessions were supposed to expire when the browser was closed?
- Skoalbasher
- Forum Contributor
- Posts: 147
- Joined: Thu Feb 07, 2008 8:09 pm
Re: Session does not end after closing/opening browser?
If your code reaches a point you won't need sessions anymore, you could always unset it.JAB Creations wrote:This isn't very important though I noticed when I started a session, closed Firefox, opened Firefox back up, and the page loaded that I was still signed in with the session. I thought sessions were supposed to expire when the browser was closed?
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Session does not end after closing/opening browser?
It was not planned though it's not necessarily undesirable.
Re: Session does not end after closing/opening browser?
There are 10 types of people in this world, those who understand binary and those who don't
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
Re: Session does not end after closing/opening browser?
Not to insult your intelligence, but did you have another iteration of Firefox open?
To get my sessions to end, I have to be sure that all iterations of Firefox are closed.
To get my sessions to end, I have to be sure that all iterations of Firefox are closed.
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Session does not end after closing/opening browser?
Like I said it's not necessarily an undesirable effect.
I did actually lose my tabs in Firefox 3 this morning when Firefox 2 updated though that's unrelated. I don't usually run multiple instances of Firefox and I check the processes running in XP's task manager several times a day without fail.
My only important question is this a possible security concern? In example a computer in a public environment is there any risk there?
I did actually lose my tabs in Firefox 3 this morning when Firefox 2 updated though that's unrelated. I don't usually run multiple instances of Firefox and I check the processes running in XP's task manager several times a day without fail.
My only important question is this a possible security concern? In example a computer in a public environment is there any risk there?
Re: Session does not end after closing/opening browser?
I'm pretty sure you can answer this by yourselfJAB Creations wrote:My only important question is this a possible security concern? In example a computer in a public environment is there any risk there?
There are 10 types of people in this world, those who understand binary and those who don't
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Session does not end after closing/opening browser?
I'm not that sharp in the AM... 
If the default is 0 and ends the session when the browser closes then this is not working.
I also get the following error message...
Suggestions please?
Code: Select all
session_name("member");
session_set_cookie_params();
session_start();I also get the following error message...
I had tried session_set_cookie_params("0"); and the browser session still persisted after closing and reopening the browser.Wrong parameter count for session_set_cookie_params()
Suggestions please?
Re: Session does not end after closing/opening browser?
Do you have that "Save your closed tabs for the next time" enabled in FF?
It may store more information than just the tab URLs.
It may store more information than just the tab URLs.
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Session does not end after closing/opening browser?
Yeah, I actually started using that feature earlier this year. It's a life saver. 
So how do I work with that issue then?
So how do I work with that issue then?
Re: Session does not end after closing/opening browser?
Sorry to jump in here .... not too much to add really ... just wondering ... why do you use this line?
I see people use it in examples, but I've seriously never used it and have no idea why it would be needed. I get what it does ... I just don't get why.
Also ... shouldn't that middle line be ... The manual doesn't seem to indicate that the lifetime parameter is optional, and would therefore have no default setting. Would it?
As for the multiple tabs thing ... well ... I don't believe there is a workaround apart from having the user log out and destroying the session. Or you could update a timestamp in the session on each page view and destroy the session or request a re-auth if a page view turns up after a certain period of time. It wont stop it, but it narrows the time-slot for session manipulation down. Although, you'd think that just setting a timeout value would provide the same result.
Anyhow .... cheers.
Code: Select all
session_name("member");Also ... shouldn't that middle line be ...
Code: Select all
session_set_cookie_params(0);As for the multiple tabs thing ... well ... I don't believe there is a workaround apart from having the user log out and destroying the session. Or you could update a timestamp in the session on each page view and destroy the session or request a re-auth if a page view turns up after a certain period of time. It wont stop it, but it narrows the time-slot for session manipulation down. Although, you'd think that just setting a timeout value would provide the same result.
Anyhow .... cheers.
Re: Session does not end after closing/opening browser?
It's the only way to distinguish between sessions owned by different applications on a same site (e.g. a site with a login feature and PHP MyAdmin application).Stryks wrote: ... just wondering ... why do you use this line?I see people use it in examples, but I've seriously never used it and have no idea why it would be needed. I get what it does ... I just don't get why.Code: Select all
session_name("member");
Yes, I think it's the same.Stryks wrote: Or you could update a timestamp in the session on each page view and destroy the session or request a re-auth if a page view turns up after a certain period of time. It wont stop it, but it narrows the time-slot for session manipulation down. Although, you'd think that just setting a timeout value would provide the same result.
There are 10 types of people in this world, those who understand binary and those who don't
Re: Session does not end after closing/opening browser?
Ahhh ... And the light goes on.VladSun wrote:It's the only way to distinguish between sessions owned by different applications on a same site (e.g. a site with a login feature and PHP MyAdmin application).
Thanks for that. I've often wondered.