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

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

paulCardiffAsked:
Who is Participating?
 
Abu HamdanEnterprise Architect, PM ExpertCommented:
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
 
paulCardiffAuthor Commented:
sesions not an option sorry as this is working accross multiple domains - any other suggestions? i.e. specifically why IsPersist isn't working ?
0
 
Abu HamdanEnterprise Architect, PM ExpertCommented:
What is the data that you are trying to save ? sepecific to user ? or to all users ?
0
 
paulCardiffAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.