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. |
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....
|
|||||||
|
|||
|
hi , can u tell me the diffrence between cookies and the session variables n what is the effects of session variables.
|
| The Following 4 Users Say Thank You to pooja007 For This Useful Post: | ||
| Sponsored Links |
|
|||
|
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] |
| The Following 4 Users Say Thank You to nithui For This Useful Post: | ||
|
|||
|
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] |
| The Following 2 Users Say Thank You to nithui For This Useful Post: | ||
|
|||
|
Re: diffrence between cookies and session variables
Quote:
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 |
|
|||
|
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. |
|
|||
|
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. |
|
|||
|
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. |
|
|||
|
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) |
|
|||
|
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.
|
|
|||
|
Quote:
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. |
|
|||
|
Re: diffrence between cookies and session variables
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. |
|
|||
|
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 |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |