Hey,
I've spend ages looking into the problem, but I cant find it.
This is my page code
So after the user presses the Login button there should be 3 variables stored in a session, this works (checked using trace='true')Code:Protected Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click Dim blnLogin As Boolean blnLogin = Login(txtUserLogin.Text, txtPassword.Text) If blnLogin = True Then Session("LoggedIn") = "" Session("LoggedInUser") = txtUserLogin.Text Session("LoggedInID") = GetUserID(txtUserLogin.Text) lblNotice.Text = "Login succeeded: " '& GetFriends(Session("LoggedInUser")) Else lblNotice.Text = "User not found" End If End Sub Protected Sub btnAddToWall_Click(sender As Object, e As EventArgs) Handles btnAddToWall.Click MsgBox(Session("LoggedInID")) End Sub
Session State
Session Key Type Value
LoggedIn System.String
LoggedInUser System.String User
LoggedInID System.Int32 2
That's fine. Now I click on the AddToWall button to check if I can get the LoggedInID, it shows an empty messagebox.
In the trace there are no Sessions keys left.
How can I make it keep the keys after postback/after clicking on buttons?
Note: When calling GetFriends(Session("LoggedInUser")) in the same sub as the Login button the variable does get passed to the class with sub GetFriends()
Here's my web.config
Code:<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> <sessionState timeout="30" /> </system.web> </configuration>




Reply With Quote