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
Explain transparent caching with aop?
How you can return View from ASP.NET Web API method?
What is cookieless session id explain in brief?
What’s difference between “optimistic” and “pessimistic” locking?
What is synchronous and Asynchronous post back ?
What are the options in ASP.NET to maintain state?
What is clickid?
What is session in http request?
Can you change a Master Page dynamically at runtime?
What websites use asp.net?
Is asp.net mvc front end or backend? : Asp.Net MVC
What is css in asp.net?
What is asp.net file?
Where is the view state data stored in asp net?
Explain how asp.net different from asp?