![]() |
|
|
|||||||
| VCL4PHP VCL for PHP. Questions or comments about the Visual Component Library for PHP, post them here! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I do something like this directly at the top of a page that requires to be logged in:
PHP Code:
When this page is loaded, the VCL adds a whole bunch of additional values to the $_SESSION array. Now I am logged in and the page is shown as should be. If I load the page again in another browser tab, the above code still "sees" LOGGEDIN as true and doesn't redirect to login.php. But when the VCL include: PHP Code:
That results in the page being shown but with no meaningful contents because the $_SESSION values are not there anymore. Now I am not sure if opening the logged in page again in another browser tab is considered to be a new session or not. But if it should be a new session, why are the $_SESSION variables still valid at the beginning of the php script? If it should not be a new session and the user should be logged in at the new tab, too, why does the VCL delete my $_SESSION variables? Thanks for any insight! |
| Sponsored Links |
|
|
|
|||
|
Yes, I am running it out of the IDE, so that might cause the problem.
How would I run it without the IDE, but locally on my machine (Windows XP PC)? The IDE creates some URLs that seem to call PHP to run the scripts. Is there an easy way to do this manually? |
|
||||
|
apache friends - very easy apache, mysql, php and perl installation without hassles
But you can also run them after deleting the restore_session from the url. |
|
|||
|
I found this post about restore_session, which seems to solve the problem:
VCL for PHP :: View topic - Avoid "?restore_session=1" and keep session data Question: Wouldn't it be easier to just get rid of the GET-variable "restore_session" if it exists? Something like PHP Code:
It seems to work fine, or do I miss anything? Last edited by Holgerwa; 30th June 2009 at 15:13. |