Answer Posted / shalini
If cookies is not supported then cookieless sessions is
the best option. If you set the cookieless attribute of the
sessionState element to "true" in your web.config, you will
notice that sessions still work perfectly when invoking
your Web methods using the browser interface.Code for using
cookiless session is:(.aspx code)
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href='/HttpSessionState/
(l2z3psnhh2cf1oahmai44p21)/service1.asmx'>here</a>.</h2>
</body></html>
Code for using cookiless session is:(aspx.cs code)
[WebMethod(EnableSession=true)]
public bool Login(string user, string pwd)
{
Session["extuser"] = user;
return true;
}
[WebMethod(EnableSession=true)]
public String getUser()
{
return Session["extuser"].ToString();
}
Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
What's the use of response.output.write()?
Why session is necessary in web application?
What is difference between Fragment Caching and Page Caching in ASP.NET?
What is the difference between union and structure?
Will session work if cookies is disabled?
What is session authentication?
What is viewstate parameter?
What is an asp.net web form?
How you can return View from ASP.NET Web API method?
How do you change the session time-out value?
Can you explain one critical mapping? Performance issue which one is better?
Who can consume WebAPI?
What is the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc
What is the asp.net control toolkit?
What does session_start () do?