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

What is difference between URL and URI?

636


Explain Apache web servers ? How can you get ASP.NET running in Apache web servers - why should you do this?

519


What is the difference between session and viewstate in asp.net?

620


Which object wraps the state or data of a user?

555


If Instancing = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?

1985






in which protocol ASP.NET WEB API Work?

621


Where the assembly is stored in asp.net?

556


Explain what does wsdl stand for?

567


Give me one example of Web API Routing?

608


What is a session http?

527


What are client activated objects and server activated objects?

527


Explain different types of validators in asp.net?

539


Suppose You Want A Certain Asp.net Function Executed On Mouseover For A Certain Button. Where Do You Add An Event Handler?

650


Explain Life cycle of ASP.NET page when a request is made.

757


What is web router?

507