Solved

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

Posted on 2007-12-03
4
250 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

785 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