Re: Execute code after session expire
by roboticus (Chancellor) on Apr 24, 2014 at 05:29 UTC
|
rjit17@gmail.com--
That depends on the situation. So ... what's the situation? Care to give any clues about your environment and what you're trying to do?
...roboticus
When your only tool is a hammer, all problems look like your thumb.
| [reply] |
|
My situation is like :
I made one web site where user can upload text file.
I want to delete that text file from my server when session will expire for that particular user.
I also want to set the time for 10 min for session expire.
| [reply] |
|
rjlt17@gmail.com:
OK, then when you create your text files, log them into a database along with their expiration date. Then have a cron job wake up every five minutes, and run a script to delete all files whose expiration date has passed.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
| [reply] |
|
|
|
so this "session expire" is some kind of jar of pickles?
| [reply] |
Re: Execute code after session expire
by CountZero (Bishop) on Apr 24, 2014 at 05:57 UTC
|
There has to be *some* code *somewhere* that makes your session expire. Add your "post expiry" code to the end of that code.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James My blog: Imperial Deltronics
| [reply] |
|
hi CountZero,
Their is a simple code for session expire called expire();
But I am not able to do my job using these method.Can u give me one example ,how to do it.
| [reply] |
|
| [reply] |
|
|
|
|
The code in expire could be anything. Without knowing what it is, I cannot help you. Some information why you cannot use that code would be helpful too.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James My blog: Imperial Deltronics
| [reply] [d/l] |
Re: Execute code after session expire
by davido (Cardinal) on Apr 24, 2014 at 15:51 UTC
|
This dialogue seems kind of like the following:
Q: "I would like to enter the house."
A: "Open the front door and walk in."
Q: "I cannot use the front door."
A: "Why not?"
Q: "There is a front door but I can't use it."
A: "Why can't you use it?"
Q: "There's a door at the front, and it's called front door, but I can't use it."
A: "Can you show a floorplan, and a picture of the front door?"
Q: "I want to enter the house."
After reading this dialogue, do you (the OP) have any idea why our character can't enter through the front door? Do you have a mental picture of what the door looks like? Do you know anything about its hardware? (lock, knob, etc) At the end of the dialogue you know only that there's a door, that the person wants to enter, and that there is some inexplicable reason why he believes he can't use the door. We don't know if he just needs a key, if the door is broken, if he's not invited and thus needs to find a partially open window in the basement to sneak through... maybe there's a giant piece of furniture inside the front door blocking its use. Maybe the front door is not to be used, and there's a service entrance. But we don't know. And we don't know what obstacles YOU are facing either, which means we are unable to help you until you start explaining yourself.
Show some minimal amount of real code that demonstrates your session handling as it currently exists. When someone asks "why", don't say "doesn't work" or "can't", explain your situation. Whatever problem you're facing, we probably can find someone to solve it, but we don't know enough about the problem yet.
| [reply] |
Re: Execute code after session expire
by DrHyde (Prior) on Apr 24, 2014 at 10:13 UTC
|
If there was no computer involved, and just people communicating with each other with hand-written bits of paper, how would you implement it?
... pause ...
OK, now port that to perl.
| [reply] |
Re: Execute code after session expire
by Bloodnok (Vicar) on Apr 24, 2014 at 09:28 UTC
|
| [reply] [d/l] |
|
| [reply] |
|
| [reply] |
A reply falls below the community's threshold of quality. You may see it by logging in. |