I set a session object at one juncture in my code:
Session("my_name") = "Dave"
Later in my code I give the user a chance to update this object:
Session("my_name") = TextBox1.Text
I reload my page and display a little hello statement like this:
Label1.Text = "Hello" & CStr(Session("my_name"))
The result is: "Hello Dave" no matter what I change Session("my_name") too.
EDIT: Here is the a full code-behind I wrote up to demonstrated:
Public Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ExpiresAbsolute = DateTime.Now.AddMonths(-1)
If Page.IsPostBack = False Then
Session("my_name") = "Dave"
End If
Label1.Text = CStr(Session("my_name"))
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Session("my_name") = TextBox1.Text
End Sub
End Class