Hi,
I'm trying to check on each asp page whether the
session("UserId") has expired before it redirects to
login page. Here how the process goes.

1. I am able to initialise the session("UserId") after
login to the web
Set session("UserId") = "ID"

2. However problems occurs for subsequent pages because
now the session("UserId") always remains blank.
Since I include a checking on each page for session
timeout, therefore it always redirect to login page.

If Session("UserID") = "" Then
Response.Redirect("Login.asp")
End if

3. Hence, I try to harcode the session for testing.
Set Session("UserID") = "Test"
If Session("UserID") = "" Then
Response.Redirect("Login.asp")
End if

However, it prompts an error for the new line I have
added.

Microsoft VBScript runtime (0x800A01A8)
Object required: 'Session'

For your information, it works fine on the production
server, but problem occurs in the development server (both
running Win2K Server SP3, IIS 4.0.2.4022)

Please help!! Appreciate any feedbacks. Thanks.

Regards
Wilson

Re: Object required: Session by Tim

Tim
Mon Jul 07 00:23:50 CDT 2003

you don't need "set" here...

tim


"Wilson" <chewws@accelteam.com> wrote in message
news:040f01c34442$42508790$a501280a@phx.gbl...
> Hi,
> I'm trying to check on each asp page whether the
> session("UserId") has expired before it redirects to
> login page. Here how the process goes.
>
> 1. I am able to initialise the session("UserId") after
> login to the web
> Set session("UserId") = "ID"
>
> 2. However problems occurs for subsequent pages because
> now the session("UserId") always remains blank.
> Since I include a checking on each page for session
> timeout, therefore it always redirect to login page.
>
> If Session("UserID") = "" Then
> Response.Redirect("Login.asp")
> End if
>
> 3. Hence, I try to harcode the session for testing.
> Set Session("UserID") = "Test"
> If Session("UserID") = "" Then
> Response.Redirect("Login.asp")
> End if
>
> However, it prompts an error for the new line I have
> added.
>
> Microsoft VBScript runtime (0x800A01A8)
> Object required: 'Session'
>
> For your information, it works fine on the production
> server, but problem occurs in the development server (both
> running Win2K Server SP3, IIS 4.0.2.4022)
>
> Please help!! Appreciate any feedbacks. Thanks.
>
> Regards
> Wilson



Re: Object required: Session by Wilson

Wilson
Mon Jul 07 01:34:10 CDT 2003

Hi Ray,
Thanks for your feedback. I am already met all 3
conditions you specified and yet still having the same
problem. However, I found out that the Session.SessionID
value keep changing each time I refresh the page. Could
this be the reason?

Any idea how to overcome this ever changing
Session.SessionID?

Thanks.

Wilson

>-----Original Message-----
>1. Don't use SET for session variables.
>2. Are you sure that this code is running server-side
and not client side?
>3. Do you have "enable session state" turned off in the
application
>settings for your site or application? I guess having
that turned off may
>make the session object not exist.
>
>Ray at home
>
>"Wilson" <chewws@accelteam.com> wrote in message
>news:040f01c34442$42508790$a501280a@phx.gbl...
>> Hi,
>> I'm trying to check on each asp page whether the
>> session("UserId") has expired before it redirects to
>> login page. Here how the process goes.
>>
>> 1. I am able to initialise the session("UserId") after
>> login to the web
>> Set session("UserId") = "ID"
>>
>> 2. However problems occurs for subsequent pages because
>> now the session("UserId") always remains blank.
>> Since I include a checking on each page for session
>> timeout, therefore it always redirect to login page.
>>
>> If Session("UserID") = "" Then
>> Response.Redirect("Login.asp")
>> End if
>>
>> 3. Hence, I try to harcode the session for testing.
>> Set Session("UserID") = "Test"
>> If Session("UserID") = "" Then
>> Response.Redirect("Login.asp")
>> End if
>>
>> However, it prompts an error for the new line I have
>> added.
>>
>> Microsoft VBScript runtime (0x800A01A8)
>> Object required: 'Session'
>>
>> For your information, it works fine on the production
>> server, but problem occurs in the development server
(both
>> running Win2K Server SP3, IIS 4.0.2.4022)
>>
>> Please help!! Appreciate any feedbacks. Thanks.
>>
>> Regards
>> Wilson
>
>
>.
>

Re: Object required: Session by Chris

Chris
Mon Jul 07 04:23:10 CDT 2003

After the login page, where are you redirecting to? Another asp page in the
same web application (session state will be maintained) or possibly to
another page in another web application (session state will be lost)?

Chris.

"Wilson" <chewws@accelteam.com> wrote in message
news:019901c34451$c6400530$a001280a@phx.gbl...
> Hi Ray,
> Thanks for your feedback. I am already met all 3
> conditions you specified and yet still having the same
> problem. However, I found out that the Session.SessionID
> value keep changing each time I refresh the page. Could
> this be the reason?
>
> Any idea how to overcome this ever changing
> Session.SessionID?
>
> Thanks.
>
> Wilson
>
> >-----Original Message-----
> >1. Don't use SET for session variables.
> >2. Are you sure that this code is running server-side
> and not client side?
> >3. Do you have "enable session state" turned off in the
> application
> >settings for your site or application? I guess having
> that turned off may
> >make the session object not exist.
> >
> >Ray at home
> >
> >"Wilson" <chewws@accelteam.com> wrote in message
> >news:040f01c34442$42508790$a501280a@phx.gbl...
> >> Hi,
> >> I'm trying to check on each asp page whether the
> >> session("UserId") has expired before it redirects to
> >> login page. Here how the process goes.
> >>
> >> 1. I am able to initialise the session("UserId") after
> >> login to the web
> >> Set session("UserId") = "ID"
> >>
> >> 2. However problems occurs for subsequent pages because
> >> now the session("UserId") always remains blank.
> >> Since I include a checking on each page for session
> >> timeout, therefore it always redirect to login page.
> >>
> >> If Session("UserID") = "" Then
> >> Response.Redirect("Login.asp")
> >> End if
> >>
> >> 3. Hence, I try to harcode the session for testing.
> >> Set Session("UserID") = "Test"
> >> If Session("UserID") = "" Then
> >> Response.Redirect("Login.asp")
> >> End if
> >>
> >> However, it prompts an error for the new line I have
> >> added.
> >>
> >> Microsoft VBScript runtime (0x800A01A8)
> >> Object required: 'Session'
> >>
> >> For your information, it works fine on the production
> >> server, but problem occurs in the development server
> (both
> >> running Win2K Server SP3, IIS 4.0.2.4022)
> >>
> >> Please help!! Appreciate any feedbacks. Thanks.
> >>
> >> Regards
> >> Wilson
> >
> >
> >.
> >



Re: Object required: Session by Evertjan

Evertjan
Mon Jul 07 04:31:15 CDT 2003

Wilson wrote on 07 jul 2003 in microsoft.public.scripting.vbscript:

> However, it prompts an error for the new line I have
> added.
>
> Microsoft VBScript runtime (0x800A01A8)
> Object required: 'Session'

Are you really runat=server, or is this an clientside (IE) error ?

> Set Session("UserID") = "Test"

Or perhaps it is the spurious "Set" ?
You cannot make this object, as it is already there in ASP.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)