•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 402,372 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,123 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 2149 | Replies: 4
![]() |
| |
•
•
Join Date: Feb 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
When someone logs out of our site, I want the previous page to not be accessible (or any of the other pages.)
So far, when a user clicks the logout button on our site, I do the following:
1) I write to a file
2) erase the session cookie
3) disable the back button.
When each page loads on our site, it checks to make sure the login file has the correct variable, checks to see if the session cookie has a value. The session cookie is checked by javascript upon page loading, the login file is checked on the server.
Everything works but when someone hits the back button, there is enough of a delay where the page can still be viewed before the javascript redirects it.
Is there a better way to do this so that when someone clicks back, the information is no longer there at all?
Thanks!
So far, when a user clicks the logout button on our site, I do the following:
1) I write to a file
2) erase the session cookie
3) disable the back button.
When each page loads on our site, it checks to make sure the login file has the correct variable, checks to see if the session cookie has a value. The session cookie is checked by javascript upon page loading, the login file is checked on the server.
Everything works but when someone hits the back button, there is enough of a delay where the page can still be viewed before the javascript redirects it.
Is there a better way to do this so that when someone clicks back, the information is no longer there at all?
Thanks!
•
•
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation:
Rep Power: 5
Solved Threads: 20
Don't break the back button. The back button can take you back past your own page to pages visited before, so breaking it annoys people.
You should probably do the cookie checking through Perl, not Javascript. That way, when your user hits the back button they either get a cached version of the page (they were authorized to view it in the first place), or they get a "You have been logged out" message. If you're really worried about cached pages like that, you can add a custom header that says the page expired sometime in the past. (1969 would be a good year.)
You should probably do the cookie checking through Perl, not Javascript. That way, when your user hits the back button they either get a cached version of the page (they were authorized to view it in the first place), or they get a "You have been logged out" message. If you're really worried about cached pages like that, you can add a custom header that says the page expired sometime in the past. (1969 would be a good year.)
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
•
•
Join Date: Jun 2006
Location: UK (Bristol)
Posts: 225
Reputation:
Rep Power: 3
Solved Threads: 1
•
•
•
•
If you're really worried about cached pages like that, you can add a custom header that says the page expired sometime in the past. (1969 would be a good year.)
Just as a side note (seeing as you seem to have solved the OP's problem), setting an expiry date for things that is before Jan 1st 1970 may cause the integer representing that date at system level to wrap around and become something close to 2038.
See here: http://computer.howstuffworks.com/question75.htm
It usually best to use 00:00:01 Jan 1 1970 to make objects expire instantly. Just a helpful tip
.Steven.
Hello, you're through to Steven on the BT Business technical help desk. Could I take your broadband telephone number please?
•
•
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation:
Rep Power: 5
Solved Threads: 20
Use the CGI module.
http://search.cpan.org/dist/CGI.pm/CGI.pm#HTTP_COOKIES
(For your convience, the link will show the HTTP cookies section first.)
http://search.cpan.org/dist/CGI.pm/CGI.pm#HTTP_COOKIES
(For your convience, the link will show the HTTP cookies section first.)
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Perl Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Chat system (ASP.NET)
- Chat system for students!! (Java)
- Chat system for students!! (VB.NET)
- System CPU overusage (Windows NT / 2000 / XP / 2003)
- would somebody buy this for me? (Troubleshooting Dead Machines)
Other Threads in the Perl Forum
- Previous Thread: Basic Perl Web Upload Script
- Next Thread: Get the location of the perl script


Hybrid Mode