How Can I Detect Whether A User Is Using Cookies or not?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
superwormy
Forum Commoner
Posts: 67
Joined: Fri Oct 04, 2002 9:25 am
Location: CT

How Can I Detect Whether A User Is Using Cookies or not?

Post by superwormy »

I'd like to be able to detect whether or not a user is accepting cookies, and IF THEY ARE NOT, then be able to revert back to passing their Session ID through the URL.

Is there any way that I can detect whether or not a user is accepting cookies?
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

i know you could set a cookie on one page and on another try and find it. im not exactly sure how you might detect this within the same script.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

since cookies are sent within the response header and the client does not send a confirmation probably no way......
superwormy
Forum Commoner
Posts: 67
Joined: Fri Oct 04, 2002 9:25 am
Location: CT

Post by superwormy »

Yeah I realize that, I was hoping there was a better way, because the way I have it setup then I need to redirect the person or something fancy... hrmph.

Any other ideas?
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

none i can think of.

just a point of note about your site indicated in your profile: in you html source you are throwing around directoy structures which is a potentially huge security risk.
superwormy
Forum Commoner
Posts: 67
Joined: Fri Oct 04, 2002 9:25 am
Location: CT

Post by superwormy »

throwing around directory structures... what do you mean? do explain so I can fix it!
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

well, at the top of the html source is a comment that looks like this:

Code: Select all

<!--- LogoSoftwear.com Header File /some/false/path/header.php --->
there are similar lines throughout your html source which expose your directory structure quite a bit.
Post Reply