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
In which event are the controls fully loaded?
Which is the parent class of the web server control?
Explain the difference between dataset and datareader.
Define tracing.
What are sessions and cookies?
How Session use Cookies in State Management?
Can asp.net work on an nt server?
What are uri parameters?
How do you secure your configuration files to be accessed remotely by unauthorized users?
Differentiate between a page theme and a global theme?
What are the asp.net list controls and difference between them?
What is the difference between union and join?
What are the features of asp net?
Explain how to prepare culture-specific formatting in .net.
Why web api is better than wcf?