![]() |
|
#1
|
||||
|
||||
PHP Sessions questionmy GIDTopsites script is 85% ready... it was built from the ground up (so MAJOR personal achievement for me)
but i am stuck trying to get the sessions to work (if the user has NOT enabled cookies). so, i want the session id to be 'passed' through the url instead but don't know how - any ideas? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
||||
|
#2
|
|||
|
|||
|
OK, as far as I know the developers of PHP thought of this and have included a compile-time directive "--enable-trans-sid" which automatically appends the session id to the URL if the user has cookies turned off. How you test for this, I don't really know, but if it hasn't been happening for you, then I guess it's not there.
Also in php.ini there'll be an option to enable it. If you can, set it to session.use_trans_sid = 1 If your host has this disabled, I heard there is a way of overriding this through your .htaccess files. I'll do more research & see if it's true. Otherwise you'll just have to do it the old fashioned way. Just call session_id() to obtain the session id. Then you'll have to append it manually to each link you create in a page - best left to a function really as it'll get very repetitive. So Code:
You also have to worry about naming the session so that PHP won't create a brand spanking new session every time. Call the function session_name() before session_start() to reference the users session like so: Code:
I hope this helps. Please note that I'm assuming register_globals = off. Garth Farley |
|
#3
|
||||
|
||||
|
yes, u're right, i ACTUALLY got the session appended to the url (automatically) when I tested it for the first time - this despite my browser generally accepting cookies!
then, on the 2nd try, i lost it and it got inside a cookie and i cannot get it back despite switching cookies off for my browser. so far, no one has reported any problems logging-in and staying logged in so i assume it's working on the LIVE server. thanks anyway... __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question about loading php into tables or css | pcxgamer | Web Design Forum | 6 | 17-Sep-2005 21:08 |
| Optimizing your web server with Turck MMCache for PHP | JdS | Web Hosting Forum | 2 | 07-Jan-2004 07:48 |
| apache2 - php cgi fehler - schleife | inna | Apache Web Server Forum | 8 | 27-Nov-2003 09:55 |
| [Linux] Installing PHP --with-mcrypt | JdS | Web Hosting Forum | 0 | 20-Aug-2003 08:40 |
| All the big PHP script collections that matter | jrobbio | MySQL / PHP Forum | 5 | 06-Jun-2003 16:14 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The