This topic is locked

Using session('USERID') in other ASP pages

8/5/2008 4:33:41 AM
ASPRunnerPro General questions
Z
zion4ever author

Hello dear people,
I really hope you can help me out here. Is it possible to use ASP pages (not generated by ASPrunner) and tap in to the session variables?

I have a calendar/event schedule ASP application which I have downloaded from a scripts repository. It uses it's own session variables in combination with a login page. I want to strip these out and use the session("userid") created by asprunner for a logon validation.
In short when you type in the url to my asprunner page you get a logon screen. Once in, on the listpage there is a link to the other asp page which is in a subdir. on my iis server (calendar\calendar.asp).Now i would very much like users not to be able to go directly to the calendar page, but must be logged on the mainpage before they may see the calendar.asp.
What code must I enter in the other asp pages not generated by asprunner to enforce a logon and thus creating a session("userid") and if a valid sessionID is NOT present redirect to the asprunner login.asp?
Thank you very much
Hans

J
Jane 8/5/2008

Hans,
you can use Session variables on the another pages as you want.

Here is just a sample:

if Session("UserID")="" then

Response.Redirect "login.asp"

else

'your code here

end if

Z
zion4ever author 8/5/2008

Works perfect!!!
Thank you Jane