Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2003-09-22, 09:00 PM
Abdul Shakoor
Guest
 
Posts: n/a
Default

Hi Every one!
I am developing an intranet php application using IIS server with PHP and MySql database. In my application when user login to the system, after authentication I will send the user to a welcome page by using header function by sending a unique session id for that user which i have generated and saved in the database, Following is the code how I use the header function.
PHP Code:
if($my_personal_profile["staffType"]=="admin") 


// Date in the past 
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 

// always modified 
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT"); 

// HTTP/1.1 
header("Cache-Control: no-store, no-cache, must-revalidate"); 
header("Cache-Control: post-check=0, pre-check=0"false); 

// HTTP/1.0 
header("Pragma: no-cache"); 


&
#036;toGo = $CFG["wwwroot"]."admin/"; // *with* an ending "/" 
header ("Location:".$toGo."welcome.php?session=$session&staffLevel=$userAccessLevel"); 


and on the welcome page I will take the session value and check if the user has logged in or not. If session does not exist I will send the user to the login page

PHP Code:
$session = $_GET['session']; 

if(!(require_login($session))) 

&
#036;toGo = $CFG["wwwroot"]."login.php"; 
header ("Location:".$toGo); 
die; 

My Problem is even though the user is logged in user will be sent back to the login page, it seems to be a problem with the caching
Any Body has any idea how to getover this problem please give me your ideas.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2003-09-24, 02:45 AM
Member
 
Join Date: May 2003
Posts: 47
barand
Default

There is a "feature" in the IIS/php cgi version that doesn't like cookies and redirection at same time. You could be running up against this. I think using the isapi version cures it. (Session id stored in cookie).

Otherwise, as a workaraound, set session/cookie and display message with a link to proceed to next page.

hth
__________________
Barand
Reply With Quote
  #3 (permalink)  
Old 2003-09-24, 07:02 PM
Junior Member
 
Join Date: Sep 2003
Posts: 3
wa8in42night
Default

barand!
I am sure you got the root cause to my problem, I am running IIS/PHP, fast CGI, as I used PHP EasyWindows Installer.

I dont think I will be using the option of displaying a link to proceed to next page.

So my problem is still there, I did not understand your solution of using the isapi version, please provide a bit more details to put me in the right direction.
Last of all If I would Install PHP as a stand alone module on IIS, problem will be cured or not.
Any suggestion about installing PHP on IIS
Reply With Quote
  #4 (permalink)  
Old 2003-09-30, 09:09 PM
Junior Member
 
Join Date: Sep 2003
Posts: 3
wa8in42night
Default

Alright sorry to all of you there was no problem in using the Header function problem was actually in my require_login($session) function.
Thanks every one
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:43 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.