Hi all,
After a visitor has loged in, a session is started.
The session is destroyed after the visitor clicked "Log out'.
When the visitor forgets to log out and closes the browser immediately, the
session stil exists because when the visitor opens the browser again and
comes back to the site he/she is still loged in.
Ofcourse i don't want that.
I want the session to be destroyed when the visitor closes the browser
immediately.
Is there a way to destroy a session when the user closes the browser and
forgets to log out.
If instead of php, javascript is necessary, please tell me also.
T.i.a.
Best regards,
Tino Wintershoven.
The Netherlands 3 13855
T. Wintershoven wrote:
Hi all,
After a visitor has loged in, a session is started.
The session is destroyed after the visitor clicked "Log out'.
When the visitor forgets to log out and closes the browser immediately, the
session stil exists because when the visitor opens the browser again and
comes back to the site he/she is still loged in.
Ofcourse i don't want that.
I want the session to be destroyed when the visitor closes the browser
immediately.
Is there a way to destroy a session when the user closes the browser and
forgets to log out.
If instead of php, javascript is necessary, please tell me also.
T.i.a.
Best regards,
Tino Wintershoven.
The Netherlands
In your php.ini file, set the value:
session.cookie_lifetime=0
Or, before EVERY session_start() call, use:
session_set_cookie_params(0);
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
Jerry Stuckle escribió:
>Is there a way to destroy a session when the user closes the browser and forgets to log out.
[...]
In your php.ini file, set the value:
session.cookie_lifetime=0
Or, before EVERY session_start() call, use:
session_set_cookie_params(0);
Apart from this, note that session data still exists on server; it will
be deleted eventually, when next "garbage" collection happens. In
general, the server has no way to know that you've closed the browser.
Usually, that's not an issue*, just be aware of it.
(*) It's an issue when you're paranoid about hackers using someone
else's session ID
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Álvaro G. Vicario wrote:
Jerry Stuckle escribió:
>>Is there a way to destroy a session when the user closes the browser and forgets to log out.
[...]
>In your php.ini file, set the value:
session.cookie_lifetime=0
Or, before EVERY session_start() call, use:
session_set_cookie_params(0);
Apart from this, note that session data still exists on server; it will
be deleted eventually, when next "garbage" collection happens. In
general, the server has no way to know that you've closed the browser.
Usually, that's not an issue*, just be aware of it.
(*) It's an issue when you're paranoid about hackers using someone
else's session ID
If you're that paranoid about hackers, you should be using https protocol.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
================== This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Pete |
last post by:
I have a site which is using sessions to pass data from one page through
to the next. The problem that I have is that there are only two places
where the session could/should be destroyed. This...
|
by: megha |
last post by:
Hi
I am writing a program in JSP which requires user to log in and as he
logs in database was updated with his status on and till the user does
not sign out no other user with same login and...
|
by: Darrin J Olson |
last post by:
I am trying to end a session for a site without having to completely close
the browser to end it.
When I access the site and log in it works fine. If I log out and in with a
different account...
|
by: Al |
last post by:
Is possible to terminate all session variable created
without closing the browser
I do not want users to click on BACK button on browser or paste the url link
in the http:// and shows the record...
|
by: Nate Spillson |
last post by:
I have an asp.net web application that uses session variables to store
user information (username, security areas, configuration data). When
the user logs into the system I store all of this...
| |
by: RC |
last post by:
hi,
I now got a session ID.
I want to try to resume a session by closing the current browser and open a
new one. Then pass the session ID in URL query string on new browser to
resume the...
|
by: joseph conrad |
last post by:
Hi,
I tried to implement my own session handler in order to keep control on
the process
the drawback I foun it is not creating and storing in my cookie the
PHPSESSID variable anymore.
reading te...
|
by: Mantorok |
last post by:
Hi
I've just been told that closing your browser closes your session on the
web-site you are viewing, is this true? If so, is this the browser that initiates
the closure, or the server?
...
|
by: Amar |
last post by:
Hi all,
I want to use a cookie that will destroy after closing the
browser, in my application.
I am able to destroy my cookie after log out,but don't know how to
destroy this when I will ...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |