Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 936
  • Last Modified:

Using Session for a speicifc Pages

I am asking this still i think this would not be possible!

i have application in which session Timeout is 24 hours!

i have 4 pages which i want that session would be 20 minutes, can i do something like this for that spicifc pages, i can use the start to be 20 minutes for only those 4 pages.

Also, i have noticed that cgi.http_referer is null is CF 8 sometimes, can i use the relevant code for this and it will work or not

Please guide
0
Gurpreet Singh Randhawa
Asked:
Gurpreet Singh Randhawa
  • 5
  • 2
1 Solution
 
gdemariaCommented:
> i have application in which session Timeout is 24 hours

Why do you want a user's session to last so long?  That is very long.  

>  have 4 pages which i want that session would be 20 minutes

The session cannot change for different pages, but if you tell us your goal, we can suggest other ideas how to do what you need to do.   For example, you could create javascript to move away from a page after 20 minutes and redirect you to a logout page.

> i have noticed that cgi.http_referer is null is CF 8 sometimes

the referrer is NULL when someone navigates directly to the page.  When someone clicks on a link and goes from one page to another, it should not be NULL.   What do you want to use this for?  It is not reliable, so use it cautiously.


Again, you should describe the problem you are trying to solve, we can help you with other ideas.

0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
this is a big issue i ma trying to solve,

session timeout cannot be changed as it is not in my hands, we applied javascript functionaity is some areas where if the user closes the tab or the browser a window.onunload event will be called and entry will be deleted from th DB!

now, this event is fired everytime the window is refreshed or any onChange evet is happenieng!

i am in the process to swicth to some alternative solution for this trouble!

if cgi.http_referer is unreliable can we use the java context which is same as cgi.http_referer

Also, what you say if i swithc from window.onUnload to window.Closed and that will handle only the X Button of the browser and nothing else!

I am considering OnSessionEnd also, if the Browser is Closed, the OnSessionEnd will execute and it will remove the entry from the Db!

Next Isue! We cannot rely properly on Javascript, If you are giving me an option of using javascript timeout of 20 minutes and setting a cookie for that specific page, then i can check for the cookie and that cookie is from the samepage whjioch is being closed, i will fire the evnt..

I know my questions seems very awkward and inrerelavant to you but now i am tuck in a very big trouble!

So guidence is needed here
0
 
gdemariaCommented:
> session timeout cannot be changed as it is not in my hands

That is too bad, because 24 hours is much too long.  You should talk to the person responsible for this and convince them that this is just wrong.

> we applied javascript functionaity is some areas where if the user closes the tab or the browser a window.onunload event will be called and entry will be deleted from th DB!

Right, that will fire on every page change.  I have seen websites that ask before you leave them, but I haven't been able to find out how.  

> if cgi.http_referer is unreliable

I don't understand how you would use this.  It tells you the page you came from.  How can that help you?  You would have to put code on SOMEONE ELSE's website to test if they just came from your site... it can't help you.

> I am considering OnSessionEnd also

You really need this,  it's one of your only ways to handle it.  However, because of your loooong timeout period, it will not run until the NEXT DAY.   You need to change the 24 hours down to 20 minutes.

>  If you are giving me an option of using javascript timeout of 20 minutes

The timeout after js 20 minutes can redirect your page to a logout page and end your session.  


0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
gdemariaCommented:
How about we look at this another way.

What if you update the user's record in the database every time they view a page.  Update the "LastActionDate" to the current date, every time they view a page.

Then setup a scheduled task to run every 5 minutes and look for users whose last action date is only than 20 minutes.  Then you can delete their records because they have not done anything for 20 minutes.

This is similar to my sugestion above that you can track the time of the lock and delete any that are old.
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
i like your this idea, let me implement it and get back to you what happens in this scenario nd its aftereffects
0
 
gdemariaCommented:

You have never really said what you need to do when the session is closed.   If you say your goal, we can help you acheive it.  We've only been discussing your idea of how to handle it.   There may be other ways.

If your goal is just to clear the locks, then use the last access date on the lock record and delete the locks after they have been untouched for 20 minutes.

If you have other goals, let us know what they are.
0
 
gdemariaCommented:

Hows it going?
0
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.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now