Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

comparing cookie to sessionID

Status
Not open for further replies.

copeZero

Programmer
Aug 31, 2007
46
CA
Hi there, No matter what i try i cant seem to compare the cookie value to the SessionID, ive tried:

int temp2 = Convert.ToInt32(Session.SessionID);
if (Convert.ToInt32(myCookie) != temp2)
....


int temp2 = Convert.ToInt32(Session.SessionID);
if (Convert.ToInt32(myCookie) != Session.SessionID)
....

int temp2 = (int)(Session.SessionID);
if (Convert.ToInt32(myCookie) != Session.SessionID)
....
 
I didn't think SessionID was an integer... I thought it was a character string.

Take your cookie and turn it into a string to compare it.

if (myCookie.ToString().Equals(Session.SessionID.ToString()))
{
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top