473,473 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Over Write Value in Session State?

Can you write over a value in session or do you have to delete the value
first then re-create it?

**Example:
I have the following value in session state...
Statement 1 -- Session.Add("Email", "someone@ someplace.com ")

And I want to change it to the following value...
Statement 2 -- Session.Add("Email", "someone@ msn.com ")

Do I just execute statement 2 or do I have to delete statement 1 first?



Nov 19 '05 #1
2 1032
Session("Email") = "so*****@msn.com"

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Leon" <vn*****@msn.com> wrote in message
news:#W**************@TK2MSFTNGP12.phx.gbl...
Can you write over a value in session or do you have to delete the value
first then re-create it?

**Example:
I have the following value in session state...
Statement 1 -- Session.Add("Email", "someone@ someplace.com ")

And I want to change it to the following value...
Statement 2 -- Session.Add("Email", "someone@ msn.com ")

Do I just execute statement 2 or do I have to delete statement 1 first?


Nov 19 '05 #2
Leon,

A sure bet is to reference the value directly as in the following:

C#:
Session["itemname"] = value;

VB.Net:
Session("itemname") = value

This method of accessing the session will set the original value, or
overright the value previously contained in the session.

Thanks,
Ian Suttle
http://www.IanSuttle.com

"Leon" wrote:
Can you write over a value in session or do you have to delete the value
first then re-create it?

**Example:
I have the following value in session state...
Statement 1 -- Session.Add("Email", "someone@ someplace.com ")

And I want to change it to the following value...
Statement 2 -- Session.Add("Email", "someone@ msn.com ")

Do I just execute statement 2 or do I have to delete statement 1 first?



Nov 19 '05 #3

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

Similar topics

2
by: Leon | last post by:
Can you write over a value in session or do you have to delete the value first then re-create it? **Example: I have the following value in session state... Statement 1 -- Session.Add("Email",...
7
by: Seth | last post by:
I have noticed that the id of my session object changes when I switch from a non-secure to a secure connection. What I'm trying to do: I have a cookie that is built on the non-secure side of...
4
by: Danny W | last post by:
Hi There! Is it possible to use HttpModule to replace the built-in ASP.NET Session object? I want to write a HttpModule that will handle storing and retrieving of session values from an external...
6
by: Kermit Piper | last post by:
Hello, I thought this should be easy, but... all I want to do is set the value of this state drop-down based on a session var I'm getting back from a redirect (from the processing page): <%...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
2
by: Jamie Schatte | last post by:
Hi, I have an ASP.NET 2.0 website that uses SQL Server session state. All works well with session state, except it seems like no matter what value I use for the timeout in web.config, the session...
10
by: rlueneberg | last post by:
I am trying to foward the old sessionID using "Session.SessionID" to an HttpWebRequest CookieContainer so that I can capture the requested page session variables but it is not working as it is...
4
by: raghav | last post by:
Hi all I am having a SP which is returning a value......Now I have to store that value in session...I saw some examples in msdn lib ----> string Name=string.Empty; Session=Name.ToString(); ...
4
by: Smokey Grindle | last post by:
What are the advantages of using ASP.NET's session state server service over using InProc state sessions? Also if you have a state server service running, is there any way to find out when a...
0
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,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.