473,549 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to declare a cookie that will destroy after browser is closed

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 close the browser.
Please help me.

Amar

Jan 31 '07 #1
3 6773
Amar wrote:
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 close the browser.
Please help me.

Amar
Hi Amar,

Change in php.ini, or use ini_set().
Look for:

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_ lifetime = 0
Regards,
Erwin Moller
Jan 31 '07 #2
Hi Amar,
>
Change in php.ini, or use ini_set().
Look for:

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_ lifetime = 0

Regards,
Erwin Moller
Isn't this called a session cookie (vs. a regular cookie)?

SV.

/just curious

Jan 31 '07 #3
On Wed, 31 Jan 2007 11:36:03 -0800, <sa********@gma il.comwrote:
>Hi Amar,

Change in php.ini, or use ini_set().
Look for:

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie _lifetime = 0

Regards,
Erwin Moller

Isn't this called a session cookie (vs. a regular cookie)?

SV.

/just curious
Session cookies are indeed set with a lifetime of 0, but setting a cookie
with that lifetime doesn't necessarily need to be used for session
management.

--
Curtis, http://dyersweb.com
Feb 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
17959
by: chrism | last post by:
Hello, I have a pop-up window that I would like to appear in front of the browser home page when a user opens IE. Problem is, I'd like it to never appear again if the user navigates back to the home page during their time using the browser. However, if the user closes the browser, then reopens, the pop-up should appear again. (you may...
4
3477
by: yingjian.ma1955 | last post by:
Hi All, According to a book, the cookie without expires lasts the browser session. I think a browser session ends if you close all the browser windows. I setup a cookie without expires in IE6 using JavaScript and closed it. When I open IE agian, the cookie is still there. Why? Does it mean that a session cookie will be deleted at some...
2
2605
by: venkat | last post by:
hi If you close the browser directly then the cookie won't get deleted. When ever you log off only it will get deleted. If you close the browser directly and again the open the browser for the same URL directly it will display as logged in page. regards
2
4752
by: George Durzi | last post by:
When you call FormsAuthentication.SignOut(), is the FormsAuthentication cookie supposed to be destroyed automatically? I'm creating my FormsAuthentication cookie by doing: HttpCookie oCookie = new HttpCookie(FormsAuthentication.FormsCookieName, sTicket); where sTicket is an encrypted FormsAuthenticationTicket. When I create the...
4
2626
by: Big E | last post by:
I set a cookie at a login screen that sets various information. When users are finished with the application most of them close the browser instead of clicking logoff. How do I clear or remove cookies when the shut down the broswer. I know how to remove them like this: Private Sub RemoveCookies() If Request.QueryString("AcceptsCookies") Is...
15
2115
by: Edwin Knoppert | last post by:
I have searched but info is limitted. In my test app i used a non persistant cookie for forms authentication. slidingExpiration is set to true On run and close and rerun the login remains ok. I have a time-out of one minute and indeed, it directs me to the login if i wait to long. The slidingExpiration does it's work also.
23
3165
by: Phil Powell | last post by:
// OBTAINED FROM http://www.javascripter.net/faq/settinga.htm // NOTE THAT IF YOU SET days TO -1 THE COOKIE WILL BE SET TO YESTERDAY AND THUS EXPIRE function setCookie(name, value, days, docObj) { var today = new Date(); var expire = new Date(); if (days == null || isNaN(days) || days == 0) days = 1; if (days >= 1 || days < 0)...
0
3210
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 documentation it seems it should do it anyway any advice?
3
2584
by: webster5u | last post by:
Miss/Mr. Programmer, I have a idea to remove the cookie value from a website after all browser closed. It is like session kept in server and eliminate after all browser closed. My purpose is reducing browsing security issue through minimize the data resident in the cookie. The reason i using the cookie instead of session because I used...
0
7967
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7819
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5097
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3488
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1953
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 we have to send another system
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
772
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.