PHP, We have sessions, and cookies....I love cookies, but they are blowing my mind right now.

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2010-05-28T03:28:56Z Indexed on 2010/05/28 3:31 UTC
Read the original article Hit count: 431

Filed under:
|

I am not sure how to go about accessing the variable I need to set on a cookie... I was thinking about using the $_POST global but I dont know how based on my design if it will work.

I am using a master page type design seperating index.php from my function includes and database information and individual pages (that will be returned to an include in index.php based on a $_GET)

Okay so back to my question. What is the most efficient way to set a cookie on a design that has a main page that everything will branch from. How would I pull the value. Is $_POST a good enough way to go about it?

Also...by saying it must be the first thing sent...does that mean I cannot run any serverside scripts before that? I could definately utilize a login query I think but I dont want to write code just to be dissapointed based on my lack of time and knowledge.

I did search for answers...I know this most likely feels like a generic question that could be answered in a difference place...but I know I will get an accurate and professional answer here...so I dont want to bet on the half answers I found otherwise.

Of course I will sanitize everything and not store any sensitive information (passwords,address,phone,or anything really for that matter besides some kind of session ID and the username)

If this is confusing I am sorry but I am on a gov computer...and they lock these tighter than ft knox...so getting my code on here will be a chore until I get back to my room.

Thanks, Matt

© Stack Overflow or respective owner

Related posts about php

Related posts about cookies