• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

PHP SESSION doesn't work when Privacy sets to HIGH

I thought session will always work even the browser doesn't accept cookies -- in that case the session ID will be passed via PHPSESSID in the URL query....

but obviously it is not the case... when I set my IE's Privacy to HIGH or BLOCK ALL COOKIES, then the session fails to work


WHY?


0
jtjli
Asked:
jtjli
1 Solution
 
EECDMLCommented:
Check your PHP.INI configuration file in the Sessions section.

See if the following is set...

session.use_cookies = 1



I haven't done much modification in this area of the INI file, but I'm sure you can get PHP running without requiring the use of cookies.
0
 
battletechCommented:
Instead of using a cookie, transmit the session ID in the URL...
0
 
OliWarnerCommented:
>> but obviously it is not the case... when I set my IE's Privacy to HIGH or BLOCK ALL COOKIES, then the session fails to work... WHY?

Because sessions require cookies to store the SessionID. The other method of doing this is to munge the session ID into the URL so you end up with something like this:
www.example.com/mypage.php?PHP_SID=dlkfj323kljf33j

Its seriously ugly. You'll also need to attach the session ID to all your links...
0
 
netmunkyCommented:
php.ini:
; trans sid support is disabled by default.
; Use of trans sid may risk your users security.
; Use this option with caution.
; - User may send URL contains active session ID
;   to other person via. email/irc/etc.
; - URL that contains active session ID may be stored
;   in publically accessible computer.
; - User may access your site with the same session ID
;   always using URL stored in browser's history or bookmarks.
session.use_trans_sid = 0
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now