PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 10th, 2000, 10:54 PM
hkccm hkccm is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Hong Kong
Posts: 24 hkccm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello

I am using the new session management function from PHP4.
session_start()

how do u redirect a user to another page if his session is expired?

here is what i want to do:

1. user Tom enter his correct username and password.
2. my system use session_register() function register a variable in his cookie.
3. user Tom clicked Logout
4. my system use session_destory() function and redirect Tom to the login page.
5. Now, Tom click the 'BACK' button of his browser, a page showed 'page expired, hit reload button ... ...'.

here is my question, how do I redirect Tom to the login page if he clicked the BACK button?



Reply With Quote
  #2  
Old June 11th, 2000, 08:51 AM
wouterr wouterr is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 27 wouterr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i guess you should use a cookie or somewhat
trigger a variable that shows if the user is logged in or not

------------------

Reply With Quote
  #3  
Old June 12th, 2000, 04:10 PM
Sepodati's Avatar
Sepodati Sepodati is offline
Banned (not really)
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 1999
Location: Brussels, Belgium
Posts: 14,628 Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)  Folding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced Folder
Time spent in forums: 3 Months 6 Days 2 h 39 m 6 sec
Reputation Power: 4375
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
I'm also running into problems with this. The problem is that the script isn't executed when the person clicks the back button, it just displays the same page that was cached. so checking a cookie or variable will not hav e any effect. i'm thinking there might be a way to do this in javascript (preventing the use of the back button entirely), and i posted something to the javascript forum. i'll let you know what i hear.

if anyone else has any ideas, please let us know...

Reply With Quote
  #4  
Old June 12th, 2000, 07:01 PM
ujludwig ujludwig is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 63 ujludwig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
To redirect the user...
header ("Location: Login.php4");

Re your javascript question, you can set the page to timeout();

Reply With Quote
  #5  
Old June 12th, 2000, 10:16 PM
Dave Bryant
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
You should be able to put head tags with nocache option set: Here are some header examples:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<meta name="ROBOTS" content="INDEX, NOFOLLOW">
<meta http-equiv="refresh" content="3600">
<meta http-equiv="Window-target" content="_top">
[/code]

I can't remember what the cache one is named but it is set with value "nocache".

Then user will be foreced to reload. Or set the refresh to low value, either way hope it helps.

------------------

Reply With Quote
  #6  
Old June 17th, 2000, 03:42 PM
trikyguy trikyguy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 1 trikyguy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
http://www.php.net/manual/function.header.php

That is where the function header. An important note is that it must come before the body of the page.

Reply With Quote
  #7  
Old June 20th, 2000, 06:52 AM
Slush Slush is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 1 Slush User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This one is also nice: You can put some more useful stuff in your the header-part. This one is very useful to prevent caching:
header ("Expires: Mon, 31 Dec 1990 06:00:00 GMT");
header ("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0

------------------

Reply With Quote
  #8  
Old June 20th, 2000, 08:30 AM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
<form>
<input type="button" value="Go" onClick="window.location.replace('nextpage.html');">
</form>

The current pages history entry will be replaced with the nextpage.html and this will also load the nextpage.html.

(originally posted by Spookster)

You can mess around with this to get the desired effect.

Simon

------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > session expired -> redirect user to another page.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap