JavaScript Overlay on Page Load Question

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
1/20/2012 3:06:06 PM
Gravatar
Total Posts 40

JavaScript Overlay on Page Load Question

On the site I'm building, the owners would like for the month of March only to have an overlay open up, once per user, per session, when the page loads, and only have it visible for about 7 seconds.

I'm confident I can create the overlay graphics and write the basic jQuery to make the overlay function, but where I really need some help / guidance / advice, is in the limiting it to only opening once per user, per session. I know next to nothing about sessions in .NET, or mojoportal for that matter; I mean how long is a "session"? Is there a default value set in .NET (or mojoportal) for this? Is it like 15 minutes, an hour?Can you check / trigger off it using JavaScript?

Or is this one of those "Yeah, great idea, but more trouble than I think you want right now" kind of ideas?

1/21/2012 7:41:42 AM
Gravatar
Total Posts 18439

Re: JavaScript Overlay on Page Load Question

Hi,

The thing to understand is that a server side session is not the same thing as a browser session. By default the IIS  session timeout is 20 minutes, so 20 minutes of no activity and the session expires and the next activity from the same user/browser will start a new session. A browser session is determined by when the browser is closed or restarted, so if the browser is left open the server side session may timeout but its still an active browser session. Note that you can close a web site but the browser session is still active if you visit the site again without closing the browser, only closing the browser expires a session cookie.

For something like this my advice would be to not use server session but use a cookie set from javascript, that cookie should be a session cookie meaning that it will expire when the browser is closed, ie when the browser session is over.

This article Add a Notification Bar to Your Web Site Using jQuery by Bipin Joshi should help you.

Hope that helps,

Joe

1/21/2012 7:44:21 AM
Gravatar
Total Posts 40

Re: JavaScript Overlay on Page Load Question

Awesome! Thanks Joe.

You must sign in to post in the forums. This thread is closed to new posts.