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 is the significance of finalize method in .net?
Can you explain page lifecycle in net?
What is application Object?
Is asp.net still used?
Securitywise What are the Enhancements in 2.0?
What are the different kinds of assemblies?
What is work flow gen? how can it will work with .Net?
What is slidemaster?
Define the term Web Garden?
Where can I get the details on migration of existing projects using various technologies to asp.net?
What is the namespace to create thread in .net?
What is the current version of asp.net?
What is ashx file in asp.net?
How can we use Web API with ASP.NET Web Form?
5. What three Specific Job Positions do you target from Swatz Oils GROUP U.K?