Solved

How do i expire a formsauthentication ticket cookie based on the life spam of a browser?

Posted on 2007-12-03
4
253 Views
Last Modified: 2008-02-01
How do i expire a cookie based on the life spam of a browser? e.g. browser close = cookie expires.

I.e. i'm currently using
Dim fat As New FormsAuthenticationTicket(1, CustomerGUID, DateTime.Now, DateTime.Now.AddYears(1), false, "")

But the cookie still exists when the browser closes despite ispersits = false

Any ideas?

NB: I can't use the global.asax or custom Javascript

Open in new window

0
Comment
Question by:paulCardiff
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
Abu Hamdan earned 500 total points
ID: 20394979
You should use sessions instead, since sessions will be abandon when the session is closed, but with cookies i dont think that you can capture the event when the explorer is closed, or the PC is turned off .. etc. So many possibilities.
0
 

Author Comment

by:paulCardiff
ID: 20394990
sesions not an option sorry as this is working accross multiple domains - any other suggestions? i.e. specifically why IsPersist isn't working ?
0
 
LVL 7

Expert Comment

by:Abu Hamdan
ID: 20395015
What is the data that you are trying to save ? sepecific to user ? or to all users ?
0
 

Author Comment

by:paulCardiff
ID: 20395157
Sorry this was a case of me over complicating a simple concept - problem solved i.e. i was creating my own cookie and not utilising GetAuthCookie.

Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question