Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Variables (without cookies)

Status
Not open for further replies.

gbrian

IS-IT--Management
Sep 22, 2004
96
US
If a server is setup with the default session.use_cookies "1", how can I use session variables without using cookies?

The problem is this:

Search engine optimization is interfering with my menus as it has query parameters ie > sidebar.php?mainMenu=1&subMenu=2, etc... I cannot pass variables this way.

Cookies would also not work, as I do not want my menu to RELY on cookies (if someone has them disabled- they can't browse the site).

hidden input on forms is an idea-- but I am unsure of the efficiency of integrating this with every menu item.

So the question remains--how can I force the session variables to store on the server instead of client cookies?

THANKS!!!
 
Thoughts:

1. People who turn cookies off probably also turn JavaScript off.
2. hidden input in forms means every page has to POST to go to the next page. Menus can only submit() via JavaScript.

You can use transparent Session IDs which are appended to all URLs automatically by the PHP engine. Read about that in the PHP manual under sessions.

Clarification:
Session variables never store in a cookie. They are always on the server. The cookie transports only the SESSION ID.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top