Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

TempData on SignOut #6

Closed
sweeperq opened this issue Jan 13, 2014 · 3 comments
Closed

TempData on SignOut #6

sweeperq opened this issue Jan 13, 2014 · 3 comments

Comments

@sweeperq
Copy link

I just started using CookieTempData provider on a site I'm developing. I'm utilizing it to store success/error messages that need to be preserved on redirects.

It works well on most pages. However, if I use it when signing out of my site using FormsAuthentication.SignOut(), the TempData is not persisted on the Redirect.

I used Fiddler to verify that there are no intermediate redirects occurring.

I wasn't sure if FormsAuthentication.SignOut() was doing something extra behind the scenes so I tried manually expiring the authentication cookie. However, the odd behavior still occurred.

I'm wondering if it has something to do with expiring HttpOnly auth cookies.

This was in VS 2013 / Embedded IIS / .Net 4.5

@brockallen
Copy link
Owner

TempData is signed and part of the input to the signature is the current username. So if you're preserving tempdata across a request where the authentication is changed (signin or signout) then the tempdata will be corrupt (will not work).

@sweeperq
Copy link
Author

Thank you for verifying. I wanted to make sure it was isolated to authentication and didn't have something to do with getting/setting other cookies.

@brockallen
Copy link
Owner

No problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants