473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Cookies VS. SessionState

Well guys some might consider this a silly topic but i just want to get
the general consensus on the matter.
So i ask the question "Which is more efficient to use Cookies or
SessionState Variables ?".
I'm just looking for opinions so please don’t flame me.

- Adam
Nov 17 '05 #1
4 1403
Adam,

My opinion, both I find cookieless awful looking.

Cor
Nov 17 '05 #2
They are not mutually exclusive. In fact, if you use session state,
then by default you are also using cookies. Once an ASP.NET session
starts, the server will send a cookie to the client to associate
him/her with the newly created session.

I find it more productive to think in terms of session state and view
state, and simply consider cookies an implementation detail handled by
the runtime.

Nov 17 '05 #3
Adam wrote:
Well guys some might consider this a silly topic but i just want to get
the general consensus on the matter.
So i ask the question "Which is more efficient to use Cookies or
SessionState Variables ?".
I'm just looking for opinions so please don’t flame me.

- Adam


Depends on how you want to use them:

Cookies:
- browser sends them on every request: you don't want too much data there
- are stored on the user's computer
- pro: no timeout (if you want)
- con: user can read and/or delete them
- needs serializing to string

Session:
- Stored on the server (by default in-memory, other options exist)
- You can use larger structures (but don't overdo it)
- you can store references to classes, no need to serialize (if InProc)
- times out after a while (20 minutes by default)
- users can't access/modify them
--
Hans Kesting
Nov 17 '05 #4
I like chocolate chip.
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: wellnesseducation | last post by:
I am trying to get session stating working with certain specifications right now, and am running into an issue I can't peg. I currently have session stating running have changed my web.config file...
2
by: mike parr | last post by:
I want to use cookies on my website, simply to identify the user when they come to my website (I will just be writing one for new users and reading from people who are already users when they reach...
1
by: Thomas Scheiderich | last post by:
Just when you figure out one problem another one shows up. I am trying to set up authentication for one of my folders and can't seem to get it to work as advertised (I am sure I am missing...
4
by: Oscar Onorato | last post by:
Hello colleagues: Somebody know that good alternatives I have, in addition to the cookies, to maintain the session state? Where an example of it can be seen? Thanks
8
by: tshad | last post by:
I am trying to get my authentication to work and want the timeout to be 30 minutes, but only while the browser is active. If the browser closes, I want the cookie to disappear. Is this...
2
by: Brett | last post by:
I'd like to maintain state between webpages without using cookies. Does ASP.NET allow sessions via URL or some other method than cookies? Any comments and web references are appreciated. ...
2
by: Philipp Schumann | last post by:
....BUT for _custom_ HttpHandlers. How can I do that? In my custom IHttpHandler, HttpContext.Current.Session is a null reference, and I can't use the session state. It is enabled in web.config...
10
BezerkRogue
by: BezerkRogue | last post by:
I am trying to use cookies to manage session states in an ASP.NET application. The states need to persist only while the browser session is open. My web.config setting is: <system.web>...
3
by: Chris Zopers | last post by:
Hello, I've read somewhere that sessionstate does not work when a browser has disabled cookies, so I wanted to test this and did the following: I added two aspx pages (c#), in the first I set...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.