C# Tutorials and offshore development in India
Tutorials Resources Forum Reviews Communities Interview Jobs Projects Training Your Ad Here


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

How to store the login information for my website?


Posted Date: 05 Jul 2009      Posted By: Albert Jose      Member Level: Gold     Points: 1   Responses: 2



Dear all experts

I am having a query regarding sessions

I am having an online website which requires customers to login and view the things in my site

my Query is

1)What is the use of sessions?
2)Why we don't use cookies instead of sessions?
3)what we store in a session? and how with ex?
4)will we use sessions and cookies?
5)what are the advantages and disadvantages of cookies and sessions.
6)examples of cookies and sessions with some source code?
7)for login information what all we save in sessions and in cookies?

I am not clear with sessions and cookies thats why i asking these all


Kindly give some good answers

Thanks and regards
AJ





Responses

Author: K'ran    05 Jul 2009Member Level: GoldRating: 3 out of 53 out of 53 out of 5     Points: 3

Basically we are using sessions and cookies all of these to maintain state management

1)Cookies is very light weight and they are store only string values and store in client side (browser)

2)very limited size

3)But session can store any type of data and session is transfer data from server to client

for more info



http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx

Kiran Kumar Koyelada



Author: Devendra    05 Jul 2009Member Level: GoldRating: 3 out of 53 out of 53 out of 5     Points: 3

1)What is the use of sessions?
Session Is Browsers specific Variables which stores the data at server side

2)Why we don't use cookies instead of sessions?
We Use Both as per our need.

3)what we store in a session? and how with ex?
In Session We use those vaibels which we want to keep at server side and want to use through out website Like UserId after Login

To set Session variable
Session["UserId"] = GetUserId;

To get Session Variable
string UserId = Session["UserId"].ToString();


4)will we use sessions and cookies?
Yes Both can use in Same Application

5)what are the advantages and disadvantages of cookies and sessions.
There Are many advantages and disadvantages of Cookies please refer MSDN. But one thing I want to clear you its totally depend on your requirement.

6)examples of cookies and sessions with some source code?
HttpCokiee cok = new HttpCokiee();
cok.Add("Test",Value);

For Session I have Given you already

7)for log in information what all we save in sessions and in cookies?
For remember me we use Cookies but for UserId comes from database we use session

Way To Technology
Softway India



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Add control dynamically
Previous : How to deploy web service to iis in vb.net?
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages




About Us    Contact Us    Privacy Policy    Terms Of Use