Session State Manage in WCF REST and ASP.NET MVC WebAPI

MohitPandit
MohitPandit used Ask the Experts™
on
Hi Folks,

Can we maintain session state in WCF REST and ASP.NET MVC WebAPI?

Can you please give any examples?

Best Regards,
Mohit Pandit
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try this.

Global.asax add

public override void Init()
{
    this.PostAuthenticateRequest += MvcApplication_PostAuthenticateRequest;
    base.Init();
}

void MvcApplication_PostAuthenticateRequest(object sender, EventArgs e)
{
    System.Web.HttpContext.Current.SetSessionStateBehavior(
        SessionStateBehavior.Required);
}

Open in new window

Author

Commented:
Thanks. I'll take a look over it and let you update.

Best Regards

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial