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?
Thanks for your help
Earl 2 1882
A session cookie and a regular cookie aren't anything different as far as the browser is concerned. But yes, if you set a cookie, without an expiration date, it will remain in the browser until you close it.
"Earl Teigrob" <Ea*********@di scussions.micro soft.com> wrote in message news:7A******** *************** ***********@mic rosoft.com... 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? Thanks for your help Earl
Earl Teigrob wrote: 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?
Thanks for your help
Earl
I think that the session references a cookie by a particular ID that the
session has. If the session times out, a new one is created with a
different ID. The cookie will still be on the local machine, but the
new session won't be aware of it.
It's better to store variables in cookies (if you want), using
Response.Cookie s. This will write a cookie with your own key, which you
can reference for as long as the user or browser keeps it around.
When I use a Session state variable (usually a settings object of some
sort), I store an identifier for that variable in a cookie. If the
session times out, I lose the object, but I can easily rebuild it using
the cookie's data. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Pack Fan |
last post by:
I've noticed that session variables will persist on Mac IE even after all
browser windows have been closed. One must quit the program to clear the
session variables. This presents a security risk for my session variable
based security scheme.
Basically, the risk is that a user will login to my site, close the window
when done and allow someone else to come up to the machine, go back to my
site and be logged into the previous user's...
|
by: David Lozzi |
last post by:
Hello All,
I am having an issue with thus far one computer on my client's web site. If the user loads the shopping cart and then closes all browser windows, then opens them back up, goes back to the site, the shopping cart information is there! The shopping cart info is only loaded into a session variable! There are no cookies on the site to store this information. Am I mistaken in believing when a browser window is closed that the session...
|
by: John Dalberg |
last post by:
What happens when a cookie expires? Does it mean that when the browser or
sessions ends, it doesn't get saved?
I am using Opera and looking at available cookies and I can some cookies
that have expiration dates in the past. Does this mean that they are in
memory and they are still valid cookies which sites can test for their
existance and return true. I thought if a cookie's expiration is set in the
past, it gets removed from memory and...
|
by: WJ |
last post by:
I am setting the Session State TimeOut to 54 minutes (20 is default) in the
Web.Config. I use SQL Server to persist the session states & ID. As long as
I am remaining in the web sites, I see all the data persisted from page to
page. However, once I quit the browser (MS/IE 6.1) and got backin within 2
seconds, the persisted data no long existed. My impression on the "timeout"
paramter is that as long as I come back to my site within the...
|
by: Doug |
last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on
"search.mydomain.com"; hence, a new session and cookie are being created on
every sub-domain.
This is occuring because ASP.NET always sets the Session cookie domain to
the full domain (e.g. "www.mydomain.com") instead of the parent domain (e.g.
"mydomain.com")
The problem with this is when the visitor goes to a different sub-domain
(e.g. "search.mydomain.com"),...
| |
by: Aidas Pasilis |
last post by:
I'm saving some values to the Session state and get some strange results.
To be short I'll write example code and standart behavior:
Code Example:
/////////////////////////////////////////////////////////////////////////////////////////
private void WriteToSessionButton_Click(object sender, , System.EventArgs e)
{
Session = "My value";
|
by: McGeeky |
last post by:
Is there a way to get a user control to remember its state across pages? I
have a standard page layout I use with a header and footer as user controls.
Each page uses the same layout by means of copy paste (I hear this will
improve in ASP.Net 2 via master pages).
When I navigate from one page to the next the header and footer user
controls lose their state because they are effectively different instances
of the user control.
Is there...
|
by: Hans Kesting |
last post by:
Hi,
Is it possible to share sessions between subdomains?
Say: the user logs in at www.company.com, and is redirected to
my.company.com. This is a different url for the same application. Can I
keep the session (so I still know WHO has logged in)?
The problem (as I see it) is the session-cookie. If that has a domain
of "www.company.com", it will not be transferred to "my.company.com".
|
by: Josh |
last post by:
I run a Joomla website and am familiar with php in some but not all
aspects. Currently I am trying to find some solutions related to
session handling.
Am I correct in saying that "login" is kept in sessions? I can see
active sessions in my mysql database, but is that the only place this
information is stored? Sessions and cookies I know are related also,
but how specifically (session info stored in cookies?)?
Right now, when users...
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
| |