What is cookie less session? How it works?

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


Please Help Members By Posting Answers For Below Questions

Why do we need url encoding?

519


What is the mvc model?

577


Can we add code files of different languages in app_code folder?

597


How many types of server controls do we have?Also explain differance between them taking an example of ASP.NET?

2363


What is postback and autopostback in asp.net?

525






How dataadapter.fill works?

560


Difference between using directive vs using statement?

508


Can the dictionary object be created in client?s scope ?

1988


Can viewstate be accessed in another page?

507


Can I tap into other windows livetm services?

568


What is asp.net master page?

557


What is authorization in asp.net?

573


What is caching? Explain.

549


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net?

519


In which event of the page life cycle, is the viewstate available?

522