|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
Probably a real simple prob for most of you, but... I have 3 frames (header, navigation and main frame), most of it is static except a search facility and when the link is clicked on a login.php page is invokeed in the main frame. Its a real simple login... The user types uname + pwd and then it checks your account if valid it will... PHP Code:
The search page includes a file called sess.php which does... PHP Code:
The page recognises the users account, tries to goe to the search page but then throws the user back to the login page saying session expired... Would frames have an impact to the session? I have tried echoing the $_SESSION['username']; on the next page but it outputs nothing?? ...Any ideas why? Cheers, Harvey |
|
#2
|
|||
|
|||
|
Quote:
You need to make sure that you are passing the SID around between the frames - you can add the sid in the frame src tag: Code:
src="somepage.php?<?PHP echo( SID ); ?>" You also need to make sure you are starting the session on the framed pages.
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#3
|
|||
|
|||
|
Hi Joe,
thanks for the reply, but I don't understand why the session needs to be started on all pages?? If my main frame is the only frame accessing PHP pages and the other two frames stay static why is there a need to start the session? Sorry, but it would be nice to understand the reasoning... thanks, Harvey |
|
#4
|
|||
|
|||
|
Quote:
Because you still need to append those links in the other frames with the sid to accomodate users that don't have cookies enabled. If a user does'nt have cookies enabled, and they click a link in one of the static frames that changes the page in the main frame where the interaction of the session is, there is no way that the main frame would know what the session id is unless the link in the static frame passed the sid in the url. |
|
#5
|
|||
|
|||
|
Cheers Joe,
...but the links on the left pain do not call any other PHP pages or protected pages. The whole site is static bar 1 link which opens a search utility in the mainFrame and the session does not need to be called anywhere else. Please have a look: http://sips.bmth.ac.uk ...and click onto search for placement, and try loging in as uname:test pwd:test So, in theory if there is only one link to a login page and the other frames do not have any other links to protected PHP pages, it should work? Thanks, Harvey loginpage - when login request sent it does... PHP Code:
--Session file included in all other pages does... PHP Code:
|
|
#6
|
|||
|
|||
|
Harvey,
I'm not an expert on sessions... In fact, I'm learning as I go... In speaking with Joe last week, the reason you still need to append your session id to non-protected pages is so that when your users "resume" their sessions (re-accesses the protected areas), their session will continue from where it left off. Hope that helps clear the confusion...
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Session in Frames: why doesn't it work?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|