Click to See Complete Forum and Search --> : Unable to store session variable


deszling
November 10th, 2005, 01:00 AM
Hi,

I have a problem with session variable.


Public Sub StoreVar()
session("MyVar") = "ABC"
End Sub

Public Sub GetVar()
Dim myVar as String
myVar = session("MyVar")
End Sub


In the above code, myVar is set to nothing.
The weird thing is i tried the above code using 2 browers:
Firefox and IE.
It works fine in Firefox but not in IE.
I am guessing the Session object in IE is not working due to some settings?

Can someone englighten me?

HanneSThEGreaT
November 10th, 2005, 07:17 AM
Try this:
Sub Session_OnStart
Session("MyVar") = "ABC"
End Sub

sivatvl
November 10th, 2005, 09:04 AM
Your IE might have rejected the session cookie storage
Did you check with that?

You can check that in the IE Tools->Internet options-> Privacy tab

Regards
Siva