473,657 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Newbee question: How to kill a cookie?

Hi,

I've implemented the forms authentication just like the following msdn
article http://msdn.microsoft.com/library/de...SecNetHT02.asp
(watch out for the line wrap)

Everything is working fine. Once the user is authenticated, he/she can
navigate out to the secure portion of the site and navigate back while
the ticket hasn't expired.

But the world isn't perfect and I was asked to implement a logoff
option. So I think I need to 'kill' the ticket. I've tryied a lot of
things with no success. For example (cookieName is a var containing
the cookie name generated by the FormsAuthentica tionTicket object):

Context.Request .Cookies[cookieName].Expires = DateTime.Now;
or
Context.Respons e.Cookies[cookieName].Value = null;
or
Response.Cookie s[CookieName].Expires = DateTime.Now;
or
Response.Cookie s[CookieName].Value = "";
or
Response.Cookie s.Remove(Cookie Name);

None of above expired the ticket, disabling the user to navigate back
to the site's secure area.

Any idea?

TIA

Valmir
Nov 18 '05 #1
3 1766
Tried this?

FormsAuthentica tion.SignOut()

"xiko tripa" <xi*******@bol. com.br> wrote in message
news:3d******** *************** ***@posting.goo gle.com...
Hi,

I've implemented the forms authentication just like the following msdn
article http://msdn.microsoft.com/library/de...SecNetHT02.asp (watch out for the line wrap)

Everything is working fine. Once the user is authenticated, he/she can
navigate out to the secure portion of the site and navigate back while
the ticket hasn't expired.

But the world isn't perfect and I was asked to implement a logoff
option. So I think I need to 'kill' the ticket. I've tryied a lot of
things with no success. For example (cookieName is a var containing
the cookie name generated by the FormsAuthentica tionTicket object):

Context.Request .Cookies[cookieName].Expires = DateTime.Now;
or
Context.Respons e.Cookies[cookieName].Value = null;
or
Response.Cookie s[CookieName].Expires = DateTime.Now;
or
Response.Cookie s[CookieName].Value = "";
or
Response.Cookie s.Remove(Cookie Name);

None of above expired the ticket, disabling the user to navigate back
to the site's secure area.

Any idea?

TIA

Valmir

Nov 18 '05 #2
Great! Thanks a lot.

--

---------------
Valmir
"Raterus" <raterus@localh ost> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Tried this?

FormsAuthentica tion.SignOut()

"xiko tripa" <xi*******@bol. com.br> wrote in message
news:3d******** *************** ***@posting.goo gle.com...
Hi,

I've implemented the forms authentication just like the following msdn
article

http://msdn.microsoft.com/library/de...SecNetHT02.asp
(watch out for the line wrap)

Everything is working fine. Once the user is authenticated, he/she can
navigate out to the secure portion of the site and navigate back while
the ticket hasn't expired.

But the world isn't perfect and I was asked to implement a logoff
option. So I think I need to 'kill' the ticket. I've tryied a lot of
things with no success. For example (cookieName is a var containing
the cookie name generated by the FormsAuthentica tionTicket object):

Context.Request .Cookies[cookieName].Expires = DateTime.Now;
or
Context.Respons e.Cookies[cookieName].Value = null;
or
Response.Cookie s[CookieName].Expires = DateTime.Now;
or
Response.Cookie s[CookieName].Value = "";
or
Response.Cookie s.Remove(Cookie Name);

None of above expired the ticket, disabling the user to navigate back
to the site's secure area.

Any idea?

TIA

Valmir


Nov 18 '05 #3
"Raterus" <raterus@localh ost> wrote in message news:<#n******* *******@TK2MSFT NGP12.phx.gbl>. ..
Tried this?

FormsAuthentica tion.SignOut()


Sorry! It didn't work... The user's still able to navigate back to
secure area even after calling FormsAuthentica tion.SignOut() on the
logoff.aspx
Nov 18 '05 #4

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

Similar topics

3
3352
by: Ralph Freshour | last post by:
I wrote a small .php script that creates a cookie on my local PC - I also wrote one that deletes it. My question is this: when the cookie has been created and I run the delete .php script, when it first loads it does not delete the cookie - I always have to click on the browser refresh button - why doesn't the script execute on the first execution? Thanks...
2
3336
by: Amit D.Shinde | last post by:
Hello Experts.. I need some help regarding cookies and session objects and also global.asa file I am creating one cookie when a user logs in on my website. The cookie stores the login name of the user. I want that cookie should get deleted when user closes the browser without signing out. I think it is done in global.asa file . But i don;t know how to do it?
2
1648
by: Newbee Adam | last post by:
some said that .NET app can run on any program where rutime exists. What is "runtime" in this sense? will I have to install runtime or .net framework or .NET support on an xp machine for a .NET app to work? keep in mind I am a newbee :-) !! thanks --
7
7187
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local time reaches the set expire-time. But if it is an expire time set on my server in California, and the cookie is put on a computer that is running on London Time, and the expire time is set at the server as 20 minutes from now, the London computer...
9
341
by: EMW | last post by:
I have created a page in aspx and after a click on a button, a new page should open. How is this possible? I tried it doing it like in vb.NET with opening a new form, but it doesn't work. rg, Eric
13
9938
by: Goofy | last post by:
Does anyone know how I can kill a session by session ID ? -- Goofy
2
1412
by: Mel | last post by:
I have a selection box with 3 values. what i need is to pass 3 urls to a function that has a switch statement and based on the selection index goes on one of the tree urls. Question is how do i pass these three urls to the function i already have ? The list size may change and does not necessary have to remain as 3 thanks for lifting a newbee to greater heights
8
2140
by: =?Utf-8?B?TFc=?= | last post by:
Hello! I am just learning about forms authentication so please excuse this basic question. I am using .NET 1.1 and C#. I have created my web.config file and my login.aspx and the associated cs file using examples on MSDN. I have created a FormsAuthenticationTicket and cookie and added the cookie to the response and then set the SetAuthCookie etc. When I go to the redirected page, I am not sure how to read the cookie value so I know who...
14
1815
by: Mangler | last post by:
Can someone explain the how I can make it so that a login ( username ) can only be logged in once to a website if it is possible. What I would like to do is have it so that if dwaldman is logged in that login can't login again with another session until the old session is terminated ( logged out )
0
8403
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8737
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8509
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7345
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4168
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.