tags:

views:

88

answers:

4

Hello Sir/Madam ,

I am in need of session variable must be exist even after browser closed or system shutdown. But in my page it will not support session scope between browsers that is at first i signin with firefox while i login with chrome browser it comes to login page . Why these happen . Please any body help me to solve this problem.

Thanks and Regards, Alagar Pandi.P [email protected]

A: 

session expiry between browser and after browser or system shutdown ?

Neither after browser close nor system shutdown

Session is expired when its get timeout on server side, and it depends on each web server settings, for example, after 20 mintues.

S.Mark
why it will not support while i opened in other browser.
Mayan Alagar Pandi
If you open in different browser, its another different session.
S.Mark
hi S.Mark ,even i open browser after close it it shows that $_SESSION undefined index . Wat to do ?
Mayan Alagar Pandi
if you close and open the brower, its also another session.
S.Mark
A: 

Cookies are the only way to track users. They can either be persistent or not. If a cookie is persistent it is stored in the user's computer as a file and has an expiration date but only the browser that created it will be able to access it again. There's no way to achieve cross-browser cookies.

Darin Dimitrov
Hi Darin Dimitrov, While user login the server set flag as 1 for logged in user with their id. If user close the browser windows the session get expired i dont know why these are happened. But in case of gmail/yahoo mail it supports cross browser session variable ie if get login one page i can close that and will open any other browser it will open home page . How can i implement such a solution to my probelm ?
Mayan Alagar Pandi
Yahoo uses flash cookies: http://info.yahoo.com/privacy/us/yahoo/cookies/
Darin Dimitrov
+2  A: 

Session scope between browsers is not possible. Sessions are identified by a token, which must first be given to the user, and then passed back later by the browser in some form. Generally this is done with cookies, although it can also be done by appending the token to URLs as the visitor browses around the site.

Since web browsers are separate pieces of software with their own methods of handling cookies, you cannot share cookies between browsers, and therefore you cannot share cookie-based sessions. It is possible to copy-and-paste a URL from a web site that contains a session token into another browser and continue the session there, but most sites use cookies, so this is not often possible, and it certainly doesn't accomplish what you would like to do.

What you ask is generally considered impossible, but also usually not an issue. On the plus side, it is also a process generally understood by most users. Users do not expect to log in to a site with one browser, and then boot up another and still be logged in.

zombat
Hi zombat, But gmail and yahoo worked fine as what i am expected.
Mayan Alagar Pandi
It's quite possible you have third-party software installed, such as the Google toolbar, that facilitates this process.
zombat
A: 

Then you should use. Client side cookies rather than session variables.

Session exists only until the browser close or system shutdown.

If you still want to proceed with session variable, then store the session value in the DB and whenever the login page loads check the db if the user hasn't signed out manually, if yes then show him main page otherwise show hime the login page.

solairaja
Hi Solai, Thanks for your idea but it is not exact solution. Gmail and Yahoo works fine as what i am expect.
Mayan Alagar Pandi