Hi,
How can I delete the cookie in client? 5 7950
You issue the same cookie with the .expires date set to any time in the past.
DateTime dtExp = DateTime.Now.AddDays(-1);
Response.Cookies["TheCookie"].Expires = dtExp;
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"ad" <fl****@wfes.tcc.edu.tw> wrote in message news:uk**************@TK2MSFTNGP02.phx.gbl... Hi, How can I delete the cookie in client?
I know login controls of asp.net2.0 is use cookie to store the login
information.
Could this method suitable for the the cookie for login information?
"Juan T. Llibre" <no***********@nowhere.com> ¼¶¼g©ó¶l¥ó·s»D:uE**************@TK2MSFTNGP03.phx.g bl... You issue the same cookie with the .expires date set to any time in the past.
DateTime dtExp = DateTime.Now.AddDays(-1); Response.Cookies["TheCookie"].Expires = dtExp; Juan T. Llibre, asp.net MVP aspnetfaq.com : http://www.aspnetfaq.com/ asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ =================================== "ad" <fl****@wfes.tcc.edu.tw> wrote in message news:uk**************@TK2MSFTNGP02.phx.gbl... Hi, How can I delete the cookie in client?
ad,
All cookies are the same. If you know the name of the cookie, you can delete
it as Juan describes.
Peter
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"ad" wrote: I know login controls of asp.net2.0 is use cookie to store the login information.
Could this method suitable for the the cookie for login information?
"Juan T. Llibre" <no***********@nowhere.com> ¼¶¼g©ó¶l¥ó·s»D:uE**************@TK2MSFTN GP03.phx.gbl... You issue the same cookie with the .expires date set to any time in the past.
DateTime dtExp = DateTime.Now.AddDays(-1); Response.Cookies["TheCookie"].Expires = dtExp; Juan T. Llibre, asp.net MVP aspnetfaq.com : http://www.aspnetfaq.com/ asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ =================================== "ad" <fl****@wfes.tcc.edu.tw> wrote in message news:uk**************@TK2MSFTNGP02.phx.gbl... Hi, How can I delete the cookie in client?
But I did not know the name of Login controls's cookies.
How could I delete all the cookis generated by my Web Application?
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> ¼¶¼g©ó¶l¥ó·s»D:18********************************* *@microsoft.com... ad, All cookies are the same. If you know the name of the cookie, you can delete it as Juan describes. Peter
-- Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com UnBlog: http://petesbloggerama.blogspot.com
"ad" wrote:
I know login controls of asp.net2.0 is use cookie to store the login information.
Could this method suitable for the the cookie for login information?
"Juan T. Llibre" <no***********@nowhere.com> ???gco?l¢Do¡Ps?D:uE**************@TK2MSFTNGP03.phx .gbl...
> You issue the same cookie with the .expires date set to any time in the > past. > > DateTime dtExp = DateTime.Now.AddDays(-1); > Response.Cookies["TheCookie"].Expires = dtExp; > > > > Juan T. Llibre, asp.net MVP > aspnetfaq.com : http://www.aspnetfaq.com/ > asp.net faq : http://asp.net.do/faq/ > foros de asp.net, en espanol : http://asp.net.do/foros/ > =================================== > "ad" <fl****@wfes.tcc.edu.tw> wrote in message > news:uk**************@TK2MSFTNGP02.phx.gbl... >> Hi, >> How can I delete the cookie in client? >> > > >
Login Control just uses the settings of the Membership provider and Forms Auth.
Delete all cookies:
VB.NET:
Dim i As Integer
Dim cookieName As String
Dim limit As Integer = Request.Cookies.Count - 1
For i = 0 To limit
aCookie = Request.Cookies(i)
aCookie.Expires = DateTime.Now.AddDays(-1)
Response.Cookies.Add(aCookie)
Next
C#:
private int i;
private string cookieName;
private int limit = Request.Cookies.Count - 1;
for (i = 0; i <= limit; i++)
{
aCookie = Request.Cookies[i];
aCookie.Expires = DateTime.Now.AddDays(-1);
Response.Cookies.Add(aCookie);
}
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"ad" wrote: But I did not know the name of Login controls's cookies. How could I delete all the cookis generated by my Web Application?
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> ¼¶¼g©ó¶l¥ó·s»D:18*********************** ***********@microsoft.com... ad, All cookies are the same. If you know the name of the cookie, you can delete it as Juan describes. Peter
-- Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com UnBlog: http://petesbloggerama.blogspot.com
"ad" wrote:
I know login controls of asp.net2.0 is use cookie to store the login information.
Could this method suitable for the the cookie for login information?
"Juan T. Llibre" <no***********@nowhere.com> ???gco?l¢Do¡Ps?D:uE**************@TK2MSFTNGP03.p hx.gbl...
> You issue the same cookie with the .expires date set to any time in the > past. > > DateTime dtExp = DateTime.Now.AddDays(-1); > Response.Cookies["TheCookie"].Expires = dtExp; > > > > Juan T. Llibre, asp.net MVP > aspnetfaq.com : http://www.aspnetfaq.com/ > asp.net faq : http://asp.net.do/faq/ > foros de asp.net, en espanol : http://asp.net.do/foros/ > =================================== > "ad" <fl****@wfes.tcc.edu.tw> wrote in message > news:uk**************@TK2MSFTNGP02.phx.gbl... >> Hi, >> How can I delete the cookie in client? >> > > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Phil Powell |
last post by:
I am having this problem: My PHP script will set a cookie, it's there in my
/Cookies folder. I delete the cookie (I have to for testing purposes, the
PHP script I run behaves according to this...
|
by: Fred |
last post by:
I've check all the info I can find on cookies and I have gotten some
idea of how to set a cookie, set the expiration, and get the cookie
value.
But I need help bringing it all together to...
|
by: Marco Krechting |
last post by:
Hi All,
I have a page with a list of hyperlinks.
I want to save information in a cookie about the fact that I entered an
hyperlink or not.
When I click one of the hyperlinks I want this stored...
|
by: Ben Amada |
last post by:
Every time a user visits a particular page, I'm using the code below to add
a cookie that expires in 1 day.
My question is, a user may visit this page a few times within one day.
Before adding...
|
by: Urban Bettag |
last post by:
I want to use persistent cookies for my login page. For example, the user
types in his username and password. He can check a box and the system should
remember his username on a next visit. I have...
| |
by: Wysiwyg |
last post by:
After a server created cookie is processed on the client I want it removed,
cleared, or expired in the javascript block but have been unable to do this.
If I set a cookie value in the server code...
|
by: Henri |
last post by:
Hi,
My page saves user's login on user's computer using a cookie:
Dim expires As Date = DateTime.Now.AddMonths(1)
Dim cookie As New HttpCookie("login", loginValue)
cookie.Expires = expires...
|
by: jojowebdev |
last post by:
Do javascript cookies REALLY have to be this hard?
function setCookie( name, value, expires, path, domain, secure ) {
var today = new Date();
today.setTime( today.getTime() );
if ( expires ) {...
|
by: TimSki |
last post by:
Hi,
I have the following javascript function which creates a cookie
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);...
|
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: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
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: 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: 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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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.
| |