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's the use of response.output.write()?

875


Why session is necessary in web application?

614


What is difference between Fragment Caching and Page Caching in ASP.NET?

669


What is the difference between union and structure?

597


Will session work if cookies is disabled?

624






What is session authentication?

615


What is viewstate parameter?

622


What is an asp.net web form?

716


How you can return View from ASP.NET Web API method?

646


How do you change the session time-out value?

665


Can you explain one critical mapping? Performance issue which one is better?

564


Who can consume WebAPI?

667


What is the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc

638


What is the asp.net control toolkit?

654


What does session_start () do?

731