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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't set session variable from session_onstart!

Status
Not open for further replies.

hinchdog

Programmer
Feb 14, 2001
380
US
For some odd reason I can't set a session level variable from the Session_Onstart Routine in the global.asa. I can set Application level variable fine however, so i know the routine is working. When i try to set a session variable and then retrieve it i get "undefined". Here is my code (btw i'm using JScript):

function Session_OnStart ( )
{
Session('FirstName') == 'John'
}

And this is how i'm tying to retrieve it:

Response.write (Session('FirstName'))

I have no clue why this isn't working, but I guess that's why people always tell me not to using session variables. i hate when they're right.

-Frank
 
The code of Session_OnStart() doesn't seem right to me. (1) Change it from 'function' to 'Sub'.
(2) When you're assigning value into a variable, you should use '=' instead of '==' no matter in Javascript or VBScript.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top