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
Why do we need url encoding?
What is the mvc model?
Can we add code files of different languages in app_code folder?
How many types of server controls do we have?Also explain differance between them taking an example of ASP.NET?
What is postback and autopostback in asp.net?
How dataadapter.fill works?
Difference between using directive vs using statement?
Can the dictionary object be created in client?s scope ?
Can viewstate be accessed in another page?
Can I tap into other windows livetm services?
What is asp.net master page?
What is authorization in asp.net?
What is caching? Explain.
Will the asp.net validators run in server side or client side? How do you do client-side validation in .net?
In which event of the page life cycle, is the viewstate available?