Page 1 of 1
[SOLVED] Alternatives to Sessions?
Posted: Thu Jun 02, 2005 9:13 pm
by Todd_Z
I am passing a php file which generates bar charts 4 variables-
2 arrays, 2 strings.
I am doing this via $_SESSION vars, however this causing all the links to turn have PHPSESSID vars. Is there some way to pass these variables to the files without the use of sessions?
Posted: Thu Jun 02, 2005 9:15 pm
by John Cartwright
set your php.ini to this
to avoid the session id being shown in the url.
Alternatively, you can create your own class to handle session vars through a db.
Posted: Thu Jun 02, 2005 9:59 pm
by Todd_Z
Code: Select all
<?
ini_set("session.use_trans_sid",0);
session_start();
?>
Very first lines of the index, still have the phpsessids, any ideas?
Posted: Thu Jun 02, 2005 10:38 pm
by Roja
Code: Select all
ini_set('url_rewriter.tags', ''); // Ensure that the session id is *not* passed on the url.
Posted: Fri Jun 03, 2005 12:45 am
by Syranide
Uhm actually, they SHOULD have PHPSESSID vars unless you specifically don't want it (links to another site) ... PHPSESSID is automatically appended (when echoing) to ensure the session is not lost. (as the browser didn't report any sessioncompability)
Posted: Fri Jun 03, 2005 5:10 am
by Roja
Syranide wrote:Uhm actually, they SHOULD have PHPSESSID vars unless you specifically don't want it (links to another site) ... PHPSESSID is automatically appended (when echoing) to ensure the session is not lost. (as the browser didn't report any sessioncompability)
The key is that last line. Unfortunately, php can be overzealous, and even with browsers that do allow cookies to be set, can rewrite urls. (In other words, sometimes/often, php will rewrite the urls even if the browser
did report session compatibility).
Not to mention, the original poster specifically asked how you can turn that particular behavior off, which is what we answered.
The session url rewriting function can be turned off, and not lose the ability to have sessions. It just means that all users *must* allow cookies.
Posted: Fri Jun 03, 2005 8:21 am
by Todd_Z
^^^^ did the trick. Thanks!