seeker
seeker

Reputation: 3333

Submit POST data when user logged in using forms authentication

I have asp.net application that use forms authentication to control access. Let's imagine we have file page.aspx with form in it. When I press search ( submit button in the form) then POST data is sent to that script and I get search results. However if user logged out, then pressed back button in browser and then pressed search, user is redirected to login page. After login,I get that page, but no POST data is sent to that page. Is there any easy way to fix that!

Upvotes: 0

Views: 879

Answers (2)

AMember
AMember

Reputation: 3057

The forms authentication cookie is not the session cookie so if you still have your user session you might be able to store the search parameters in your user session and reload them after login.

Upvotes: 1

PanJanek
PanJanek

Reputation: 6675

POST data cannot be sent when redirecting with HTTP redirect response. So you have to change the flow of the application do detect that the user is logged out ealier:

  • Check login status with ajax request before submitting form
  • Store submited data in cookie to recreate the POST after logging in
  • Store submitted data in session before redirecting to login page

Upvotes: 1

Related Questions