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
Define satellite assemblies.
What is web api vs wcf?
In order to get assembly info which namespace we should import?
Explain code snippet to register exception filters from controller?
What are the advantages of Web API?
How does u get record no from 5 to 15 from a dataset of 100 records?
What is mta?
What is razor? : asp.net mvc
Tell me the code snippet to show how we can return 404 errors from HttpError?
What is the flow of processing of the request? : asp.net mvc
Explain the concept of View Model in MVC?
What is the difference between asp.net and mvc?
What is difference between web config and global asax?
What is content place holder?
What are validator? Name the validation controls in asp.net? How do you disable them?