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 difference between URL and URI?
Explain Apache web servers ? How can you get ASP.NET running in Apache web servers - why should you do this?
What is the difference between session and viewstate in asp.net?
Which object wraps the state or data of a user?
If Instancing = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?
in which protocol ASP.NET WEB API Work?
Where the assembly is stored in asp.net?
Explain what does wsdl stand for?
Give me one example of Web API Routing?
What is a session http?
What are client activated objects and server activated objects?
Explain different types of validators in asp.net?
Suppose You Want A Certain Asp.net Function Executed On Mouseover For A Certain Button. Where Do You Add An Event Handler?
Explain Life cycle of ASP.NET page when a request is made.
What is web router?