[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Setting Cookies - Correct Order

Asked by OldHatt45 in PHP Scripting Language, JavaScript

Tags: php, ie4+

I need to set a Cookie from a Login Page.  I have tried the set_cookie function and on a test page, I have been able to set the cookie.  On a more involved test page it isn't getting set.  Not sure why.  I have made sure of no white space, etc.  Have looked for things that would cause output to the browser but I'm still stumped.

The process I'm using goes like this:
1.  User comes to the Home page (actually could be any page on the site).
2.  Session is Started.
3.  Code runs to check for an existing Cookie. (in a separate functions php file)
4.  If a Cookie is not found, I build one.
5.  I set the cookie using "set_cookie".

Have tried using ob_start and ob_end_flush, to surround the call to the checking function.  Doesn't work.  The page also runs javascript to build the menu which is variable based on whether the user is logged in or not..  This works fine.  I can login and the menu is set correctly.  It's just that the cookie doesn't get set.  

I need to figure out why the cookie isn't getting set.  I guess the first thing to find out is what I'm doing wrong as far as the order goes.  I am asking for the following:
What order should things occur?  (Session_start, then check for cookie, etc.)  Oh, I tried moving the session start down passed the check cookie function, but this messed up since I need Session variables set to do some stuff.  

I can provide code as needed if you need to see what's going on.

Thanks

OldHatt45
 
Related Solutions
Keywords: Setting Cookies - Correct Order
 
Loading Advertisement...
 
[+][-]11/20/08 09:54 AM, ID: 23006272Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: PHP Scripting Language, JavaScript
Tags: php, ie4+
Sign Up Now!
Solution Provided By: Ray_Paseur
Participating Experts: 2
Solution Grade: A
 
[+][-]11/19/08 02:05 PM, ID: 22999194Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/19/08 02:11 PM, ID: 22999248Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/19/08 07:25 PM, ID: 23001003Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/19/08 08:18 PM, ID: 23001160Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/19/08 08:46 PM, ID: 23001239Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/19/08 08:49 PM, ID: 23001248Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/20/08 06:45 AM, ID: 23004154Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/20/08 09:21 AM, ID: 23005762Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/20/08 09:47 AM, ID: 23006170Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/26/08 09:06 AM, ID: 23043717Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_2_20070628