Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

diffrence between cookies and session variables

This is a discussion on diffrence between cookies and session variables within the ASP.NET forums, part of the Web Development category; hi , can u tell me the diffrence between cookies and the session variables n what is the effects of session variables....

Go Back   Geeks Talk > Web Development > ASP.NET
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

ASP.NET ASP.NET and ASP Related Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-12-2009
Junior Member
 
Join Date: Mar 2009
Posts: 3
Thanks: 1
Thanked 4 Times in 1 Post
pooja007 is on a distinguished road
Unhappy diffrence between cookies and session variables

hi , can u tell me the diffrence between cookies and the session variables n what is the effects of session variables.
Reply With Quote
The Following 4 Users Say Thank You to pooja007 For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 03-12-2009
Junior Member
 
Join Date: Mar 2009
Posts: 3
Thanks: 1
Thanked 4 Times in 1 Post
pooja007 is on a distinguished road
Re: diffrence between cookies and session variables

plz its most urgent
Reply With Quote
  #3 (permalink)  
Old 03-13-2009
Junior Member
 
Join Date: Feb 2009
Location: india
Posts: 21
Thanks: 0
Thanked 13 Times in 9 Posts
nithui is on a distinguished road
Re: diffrence between cookies and session variables

Hai pooja,
Basically the difference is that any data stored in a session variable is destroyed when the session ends (i.e. when the user logs off or closes the browser) but any data stored in a cookie will survive.

This is because cookies are stored on your local machine so the browser can access them each time you log in to a site with out having to prompt for the information again. This makes life easier for your user in most cases but the downside is that cookies can be blocked by some security settings.

A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too.

A session variable is not stored on your local machine so as soon as your session is ended the variable is destroyed.
anyway..

session variable is used to store information about, or change settings for a user session. Session variables hold information about one single user, and are available to all pages in one application.
follow this link, you will get the answer and other stuff related to programming. You will get your ans too.

Regards,
Nithya.R
[If its useful to you,please mark thanks]
Reply With Quote
The Following 4 Users Say Thank You to nithui For This Useful Post:
  #4 (permalink)  
Old 03-13-2009
Junior Member
 
Join Date: Feb 2009
Location: india
Posts: 21
Thanks: 0
Thanked 13 Times in 9 Posts
nithui is on a distinguished road
Re: diffrence between cookies and session variables

Basically the difference is that any data stored in a session variable is destroyed when the session ends (i.e. when the user logs off or closes the browser) but any data stored in a cookie will survive.

This is because cookies are stored on your local machine so the browser can access them each time you log in to a site with out having to prompt for the information again. This makes life easier for your user in most cases but the downside is that cookies can be blocked by some security settings.

A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too.

A session variable is not stored on your local machine so as soon as your session is ended the variable is destroyed.
anyway..

session variable is used to store information about, or change settings for a user session. Session variables hold information about one single user, and are available to all pages in one application.
follow this link, you will get the answer and other stuff related to programming. You will get your ans too.
W3Schools Online Web Tutorials

Regards,
Nithya.R
[pls mark thanks,if it useful to you]
Reply With Quote
The Following 2 Users Say Thank You to nithui For This Useful Post:
  #5 (permalink)  
Old 03-28-2009
Junior Member
 
Join Date: Mar 2009
Location: india
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
venkatabcd is on a distinguished road
Re: diffrence between cookies and session variables

Quote:
Originally Posted by pooja007 View Post
hi , can u tell me the diffrence between cookies and the session variables n what is the effects of session variables.
ans: Cookies is uaed in Client side , session used in Server Side .
Disadvantages of Using Cookies
1. User-configured refusal
2. Size limitations
3. Potential security risks


Features in session rathere than cookies :
Simple implementation
Process independent
Cookie less support
Support for server farm configurations
Extensibility
Platform scalability
Session specific events
Reply With Quote
  #6 (permalink)  
Old 06-16-2009
Junior Member
 
Join Date: Jun 2009
Location: chennai
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
pattan is on a distinguished road
Re: diffrence between cookies and session variables

The main difference between cookies and sessions is that cookies are stored in the user's browser, and sessions are not. This difference determines what each is best used for.

A cookie can keep information in the user's browser until deleted. If a person has a login and password, this can be set as a cookie in their browser so they do not have to re-login to your website every time they visit. You can store almost anything in a browser cookie. The trouble is that a user can block cookies or delete them at any time. If, for example, your website's shopping cart utilized cookies, and a person had their browser set to block them, then they could not shop at your website.

Sessions are not reliant on the user allowing a cookie. They work instead like a token allowing access and passing information while the user has their browser open. The problem with sessions is that when you close your browser you also lose the session. So, if you had a site requiring a login, this couldn't be saved as a session like it could as a cookie, and the user would be forced to re-login every time they visit.
Reply With Quote
  #7 (permalink)  
Old 06-17-2009
Junior Member
 
Join Date: Jun 2009
Location: hyd
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
9618987249 is on a distinguished road
Re: diffrence between cookies and session variables

cookies & sessions both r for state related options.
but cookies r maintained by browsers and sessions r maintained by servers, but sessions r also internally using cookies.
if we don't want this then we use cookieless=true for session state.
Reply With Quote
  #8 (permalink)  
Old 07-15-2009
Junior Member
 
Join Date: Jul 2009
Location: Iligan City
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
reyborn is on a distinguished road
Re: diffrence between cookies and session variables

The simple difference between the two is that...cookies are stored in client machine while sessions are stored in server machine.
Disadvantage of cookie is that it will not work if the client user disable the cookie or don't accept cookie.
Reply With Quote
  #9 (permalink)  
Old 09-15-2009
Junior Member
 
Join Date: Sep 2009
Location: Chennai
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Ramadurai Jayaraman is on a distinguished road
Re: diffrence between cookies and session variables

1. A cookie is a small amount of data stored either in a text file on the client's file system or in-memory in the client browser session. Cookies are mainly used for tracking data settings.

2. Cookies are stored in the user computer

3. Through browser settings we can put off cookies

4. data stored in a cookie will survive. This is because cookies are stored on your local machine so the browser can access them each time you log in to a site with out having to prompt for the information again. This makes life easier for your user in most cases but the downside is that cookies can be blocked by some security settings.







1. Session object can be used for storing session-specific information that needs to be maintained between server round trips and between requests for pages.

2. sessions are stored in the server.

3. There is no option for disabling a session in the browser

4. Basically the difference is that any data stored in a session variable is destroyed when the session ends (i.e. when the user logs off or closes the browser)
Reply With Quote
  #10 (permalink)  
Old 09-28-2009
Junior Member
 
Join Date: Feb 2009
Location: delhi
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
guarvmishra is on a distinguished road
Re: diffrence between cookies and session variables

hi pooja its gaurav ur question is very simple in session variable we find that how many times a user visit on a site & cookies is differ thing it means that
u can save ur pass & id in ur system as cookies bcoz nxt time u nt need to submit ur pass & id again & again,
thanks if u hav any prob u can cal me 9716207055.
Reply With Quote
  #11 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Oct 2009
Location: noida
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
rpsingh.88 is on a distinguished road
Smile Re: diffrence between cookies and session variables

Quote:
Originally Posted by pooja007 View Post
hi , can u tell me the diffrence between cookies and the session variables n what is the effects of session variables.
session:
It helps to maintain user states and data to all over the application.
It can easily be implemented and we can store any kind of object.
Stores every client data separately.
Session is secure and transparent from user.
cookies
A cookie is a small bit of text that accompanies requests and pages as they go between the Web server and browser. The cookie contains information the Web application can read whenever the user visits the site.
Reply With Quote
  #12 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Oct 2009
Location: noida
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
rpsingh.88 is on a distinguished road
Re: diffrence between cookies and session variables

what is difference betwwen querystring and session
Reply With Quote
  #13 (permalink)  
Old 4 Weeks Ago
Expert Member
 
Join Date: May 2009
Location: Bangalore
Posts: 984
Thanks: 155
Thanked 420 Times in 201 Posts
rijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nice
Re: diffrence between cookies and session variables

Quote:
Originally Posted by rpsingh.88 View Post
what is difference betwwen querystring and session
Hi Rpsingh,

Query string parameters are used to send data (strings) from page to itself or from page to another page.

Session variables are mainly stored on the server's memory and used to stored objects.

Depending on your application need, and if the data is sensitive or not you will have to take the decision

Hope this helps.

Thanks,
Rijus.
________________
Real Inspirational Journey.........Unanimously & Sincerely.
Reply With Quote
  #14 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Dec 2008
Location: Indore MP India
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
amit.jain10 is on a distinguished road
Re: diffrence between cookies and session variables

if you are using sessions then drop the explicit use of cookies. a cookie will be set with their session id but that takes care of itself. store everything in the session and then if somehow there is some confusion or conflict, make them re login.

as far as differences

a cookie is a chunk of info on the client side

a session is a file stored on the server, a cookie is usually set to reference the id or name of that file
Reply With Quote
Reply

  Geeks Talk > Web Development > ASP.NET

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Session Variables C D Raghavendra ASP.NET 1 08-04-2008 02:48 AM
Storing form variables in a session neelim Java 2 09-18-2007 01:37 PM
how to find the diffrence berween two dates reetasharma108 Data Warehousing 2 09-04-2007 08:20 AM
Diffrence between web based and client-server technology? Geek_Guest Data Warehousing 3 05-17-2007 09:26 AM
Simple question in Session Variables sripri PHP 1 07-16-2006 12:16 PM


All times are GMT -4. The time now is 05:27 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved