Reload main page on session timeout from frame

How can I reload the main page once a session times out i.e. if they click a link within a frame how do I instruct the main page to reload if the session has expired.
They click a link the page reloads, the session("userid") is checked and if round to be empty then I need to get them to relogin in - I suppose I could just use an intermediary page to show in the frame for them to login again but prefer to redirect back to the index page - as this has some security implications.
LVL 58
GaryAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peh803Commented:
Something like this:

1.) check to see if the session("userid") session variable has the correct contents in it
2.) if it has, write JS code to redirect the appropriate frame accordingly.  Something like this:
<%
if len(session("userid")&"")=0 then
  '' session is empty, so assume that it has timed out; now, redirect the "main" frame
%>
  <script type="text/javascript">
    top.frameName.location.href='indexpageurl.asp';
  </script>
<%
end if
%>

Hope this helps.

Regards,
peh803
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
peh803Commented:
I said:
"...if it has, write JS code..."

to be clearer:
"...if the session has indeed expired, write JS code..."

HTH,
peh803
0
GaryAuthor Commented:
D'oh, so obvious - been a long day!
0
peh803Commented:
No problem!  Glad I could help you out.

Regards,
peh803
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.