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?
[SOLVED] Alternatives to Sessions?
Moderator: General Moderators
[SOLVED] Alternatives to Sessions?
Last edited by Todd_Z on Fri Jun 03, 2005 8:21 am, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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.
Code: Select all
session.use_trans_sid = 0Alternatively, you can create your own class to handle session vars through a db.
Code: Select all
<?
ini_set("session.use_trans_sid",0);
session_start();
?>Code: Select all
ini_set('url_rewriter.tags', ''); // Ensure that the session id is *not* passed on the url.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).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)
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.
Code: Select all
ini_set('url_rewriter.tags', '');