|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
PHP Sessions & Frames
Hello All,
Just wondering if someone can help me with getting sessions working under PHP but with frames. I have followed the tutorial in the following article: http://www.devarticles.com/art/1/171/2 but this does not seem to work with frames. It creates the session in the database but doesn't create the cookie. Is this because its a nested page, hence the setcookie command is not being sent before any output from the script. The sessions does work and the cookie is created if I am to load the page in its own window. Thanks For Your Help... Harvey |
|
#2
|
||||
|
||||
|
With sessions you honestly don't even need to set a cookie if you truely don't want to, unless of course you want to have information perminately stored on the users computer such as user preferences or site style preferences.. which you could also store in a database and have it flagged as like: style 1, have a 1 in the field, style 2, have a 2 in the field, etc...
and, from what I have learned with sessions <Though I am NOT an expert by ANY means> is that in order to use the session number in any of your pages, you HAVE to use start_session(); before you try to even think about using any of your session assigned variables or the session_id() in your code so for example, you have someone authenticate and it starts a session and stores it in the cookie for future reference, and it redirects to another page.. at the start of the second page, include start_session() <the session ID will be the same unless the same user is using a different computer for the second page, or if the session has timed out> and it should pull everything over to the new page... I recomend reading ben's articles on creating a members area, they're a very good information source.. as well as Authentication 101 by Havard Lindset http://www.devarticles.com/art/1/163 both of those articles should give you enough information for passing your session variables to countless number of pages, including those in frames ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > PHP Sessions & Frames |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|