i'm currently developing a new application for a customer, and i got stuck with a request from the user.
the application is a simple web with bootstrap, the application show a couple of pages and uses webapi to perform the data interaction with the server. so far so good.
the client is asking me to create a way to save the search that the user perform for the entire session. So if the client in the current session does browse the same page, the search is reloaded to the page.
what i thought was to serialize the search when it hits the webapi in session or it would be great to save it in tempdata.
but i know that webapi is session less, and i can activate that with this:
protected void Application_PostAuthorizeRequest()
{
if (IsWebApiRequest())
{
HttpContext.Current.SetSessionStateBehavior(SessionStateBehavior.Required);
}
}
But what i want is someone to point me which is the best way to accomplish this.
Any advice will be appreciated.
Regards