SunQuest
 
           Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old January 13th, 2003, 10:12 AM
harvey_r01 harvey_r01 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Bournemouth
Posts: 37 harvey_r01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #2  
Old January 16th, 2003, 11:38 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > PHP Sessions & Frames


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway