Reload main page on session timeout from frame

Posted on 2004-11-09
Last Modified: 2006-11-17
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.
Question by:Gary
    LVL 19

    Accepted Solution

    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">
    end if

    Hope this helps.

    LVL 19

    Expert Comment

    I said:
    "...if it has, write JS code..."

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

    LVL 58

    Author Comment

    D'oh, so obvious - been a long day!
    LVL 19

    Expert Comment

    No problem!  Glad I could help you out.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Title # Comments Views Activity
    Classic ASP "Generic request error" 4 25
    Adding items to html ul from on server side. 4 42
    CSS Question.. 3 63
    Copy only dates 3 58
    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now