Author: Meltdown | Posted on: 4/5/2009 7:19:30 AM | Views : 475

Hi all ,
 Can anyone tell me why my cookie is not being set from my code below?
I log in and get to the protected page, but every time I go to the protected page I'm asked to log in again. I've searched my computer and no cookie is set. protected void LoginAction_Click(object sender, EventArgs e)
{
// Initialize FormsAuthentication (reads the configuration and gets
// the cookie values and encryption keys for the given application)
FormsAuthentication.Initialize();

// Create connection and command objects
SqlConnection conn = new SqlConnection(connectionStringBMP);

conn.Open();

SqlCommand cmd = conn.CreateCommand();

cmd.CommandText = "SELECT Role, RegID FROM Registrations WHERE username=@username " ...

Go to the complete details ...