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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sessions & session id

Status
Not open for further replies.

curvv

IS-IT--Management
Jan 11, 2001
103
ZA
Hi,

I've started using sessions not so long ago and now have a couple of problems.

1. Why can't I see the session id when I hover over a link or in the address bar -
blah.php instead of blah.php?PHPSESSID=66463udhd6dhdje89 ??

2. Everything worked fine untill now. I have two scripts. Both use sessions. When ending a session using session_destroy(); it destroys the active session of the other script. Why is this??

thank you ######## CtN ########
 
A session does not "belong" to a particular script; that's the whole point. It belongs to a period of time during which the browser and the server are in communication, and it can be read, modified, ignored, or destroyed by any script along the way. A session is a *unique* identity of this server-browser communication time, and thus you cannot have more than one at a time, unless the user starts up a complete new browser instance (not spawning a new window from the current one, but actually starting a new window by clicking on the browser icon).

As to your first question, the session ID is not necessarily passed by the URL query string unless 1) you specify it, or 2) you have --enable-trans-sid turned on in PHP, and the browser has cookies turned off. Otherwise, the session ID is passed with a cookie, so the user need never see it.

So, to help you a little more on the second question again, you should keep your session alive, but perhaps unregister specific variables as you are done with them, from script to script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top