473,791 Members | 2,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

session cookie vs. regular cookie

I want to know what's the differences between session cookie and regular
cookie.

In ASP, when we create cookie, we do the following to identify an user:

Response.Cookie s("name") = value

Is this regular cookie? How about session cookie? and when to use which?

Jul 19 '05 #1
1 2948
What you are using is a regular cookie. All the data is stored on the users
computer. Each time the user loads a page on your site, their browser sends
all the cookie data set by your domain to the server (accessible through
the Request.Cookies collection). When you request their username, using
strUsername = Request.Cookies ("name"), the server finds the appropriate
value from all the cookie data sent by the browser, and returns it to the
application. See http://www.w3schools.com/asp/asp_cookies.asp for further
information.

A session cookie is one where all the data is stored on the server (through
the Session object). The only thing stored on the clients computer is an ID
string, so the server knows which user to set / retrieve values for. They
can be set / retrieved using the following code:
Session("name") = strUsername
strUsername = Session("name")

The disadvantage of this is that it takes up server power. It is
recommended that you use it sparingly; regular cookies are best for almost
every situation. A good example of when to use it is if you have a random
code which prevents automated form submission (such as the submission code
at http://addurl.altavista.com/addurl/new). Obviously, you don't want this
data available to the user through a cookie, but you want it available on
the next page so you can check the correct code was entered. So, you store
it in the Session object.

See http://www.w3schools.com/asp/asp_sessions.asp for further information.

Hope this helps,
Blair

Matt <ma*******@hotm ail.com> wrote in article
<#8************ **@TK2MSFTNGP12 .phx.gbl>...
I want to know what's the differences between session cookie and regular
cookie.

In ASP, when we create cookie, we do the following to identify an user:

Response.Cookie s("name") = value

Is this regular cookie? How about session cookie? and when to use which?

Jul 19 '05 #2

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

Similar topics

27
7131
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate a user from information you got from the session. Each secure app on a site must challenge the user for name and password, each and every time the user accesses it (not just once and then store it in the session). If a secure app is multi-page,...
8
3798
by: Matt | last post by:
I want to know if user disable cookie, will the session still working? Actually I remember we could disable cookie in IE before (not sure what version, but I couldn't see the option anymore. Now I am using IE6. please advise! Thanks!
12
18018
by: chrism | last post by:
Hello, I have a pop-up window that I would like to appear in front of the browser home page when a user opens IE. Problem is, I'd like it to never appear again if the user navigates back to the home page during their time using the browser. However, if the user closes the browser, then reopens, the pop-up should appear again. (you may have guessed that this will be used for public access pc's.) I want to try as best I can to catch...
4
1661
by: VB Programmer | last post by:
If I have a variable I want to share in my application what is the difference between just declaring a variable (Dim strMyVar as String) and using a session variable (Session("strMyVar"))? When should I use a session variable and when should I just declare it like normal? Thanks in advance!
4
2024
by: Igor | last post by:
Is it possible to point current context's session to another active session based on a SessionID?
2
1883
by: Earl Teigrob | last post by:
I am trying to find storage mechanism that will store a variable until the browser window is closed. A query string variable would be my first choice for this but that is not easily done in my situation. Would a session cookie do the trick? From what I have read, it is persistent until the browser window closes. Is that correct? Even if the session expires, will the session cookie be available when the user continues using the application? ...
3
1766
by: nn | last post by:
Hello I have ASP.Net application configured to use cookies for session. For some reasons I can't move to cookieless model. I need access to session created in this application without cookie. I tried pass session id through url (like in cookieless mode). But this dosen't work. I know that this works in Java.while application is configured in cookie mode. How to do this in ASP.Net? How to access application session without
5
1825
by: George | last post by:
Hi, Is it possible to delay session creation in ASP.NET I want the user to browse my site without any session created (no cookies set). My pages will know that is Session = null then Session has not been created and they should not rely on it. But at the moment user puts something into shopping cart i want to trigger session creation (set the cookies) and from no own that user will have regular session. Is it doable with .NET Session or...
6
1264
by: John Kotuby | last post by:
Hi all, I am trying to get an ASPX page written in VB and VS 2008 to open more quickly inside of am Iframe in a standard HTML page. One of the things the page does is to allow users to click a link that generates an Excel file depending on the choices the suer has made on the ASPX page. The Link doesn't actually Post the page, so I can't use the Form fields to transmit data to the XLS creator. So I was using Session variables....
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10427
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9995
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.