Results from the most recent live auction are here .
20 members in the live chat room. Join Chat !
06-01-2006, 02:42 PM
· #1 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
do I always have to do session_start()???
Do I always have to do session_start, even on pages I don't want to use any session variables? Will it still remember all the variables?
Thanks
Tom
06-01-2006, 02:51 PM
· #2 Eating Pie
Name: Steve
Location: Canada
Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 (
Donate )
Hello,
You only need to really use it if you plan on calling a $_SESSION['variable'] to get what the session contains.
- Steve
06-01-2006, 02:52 PM
· #3 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
thanks - its not going to forget that variable if I don't use it though?
06-01-2006, 03:38 PM
· #4 while ($awake){ code(); }
Name: Eric
Location: Kentucky
Join Date: Mar 2005
Posts: 4,268
NP$: 1152.00 (
Donate )
It won't forgot them, I do not believe.. unless you did a session_destory, unset, or $_SESSION = array(); to kill it. I'm not sure, however. I've not worked w/sessions much tbh.
06-01-2006, 04:06 PM
· #5 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
thanks a lot - am just about to launch into a whole user script for 6yd.net. Am making a few different things for it that will run off a user database. My goodness it looks complicated though!
well... wish me luck - may be back for more help later!
06-02-2006, 12:42 AM
· #6 NamePros Staff
Name: Peter
Location: Scotland
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (
Donate )
it really depends on wether the user is using cookies or not. I beleive if the user has cookies turned off (and as such the url is appended with the session variable) then there will be no way for the server to know which session it is and will start a new 1.
06-02-2006, 07:52 AM
· #7 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
Originally Posted by filth@flexiwebhost it really depends on wether the user is using cookies or not. I beleive if the user has cookies turned off (and as such the url is appended with the session variable) then there will be no way for the server to know which session it is and will start a new 1.
so if I have a session variable $_SESSION['name'] - it will append my url with:
script.php?name=filth@...???
06-02-2006, 10:13 AM
· #8 NamePros Member
Location: Ontario, Canada
Join Date: Nov 2003
If you don't put it on the top of all pages, you will probably see some inconsistancies.
06-02-2006, 11:17 AM
· #9 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
so you are saying, put it there anyway?
06-02-2006, 01:28 PM
· #10 NamePros Staff
Name: Peter
Location: Scotland
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (
Donate )
Originally Posted by PoorDoggie so if I have a session variable $_SESSION['name'] - it will append my url with:
script.php?name=filth@...???
no it doesnt append the url with the session variables it will append it with the session name and session id so it would look something like:-
Code:
page_name.php?sid=82cf054ebb3f3a88d9e4a4c4668cd9f7
if you look in the servers temp folder you will see a file called 82cf054ebb3f3a88d9e4a4c4668cd9f7 which stores the session variables.
All of this of course really depends on the server configuration.
06-02-2006, 03:17 PM
· #11 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
oh right. So there is always a sid?
Thanks
Tom
06-02-2006, 04:13 PM
· #12 NamePros Staff
Name: Peter
Location: Scotland
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (
Donate )
yes there is always a sid (session ID) otherwise the server would have no way of recognising which session the person is using. The url is ussually only appended IF the user has cookies disabled but this behaviour can be changed in the php.ini file (or using ini_set()
06-02-2006, 05:07 PM
· #13 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
oh right. Would there be any point doing that though? Would I ever need to use a session id?
06-03-2006, 03:21 AM
· #14 NamePros Staff
Name: Peter
Location: Scotland
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (
Donate )
i take it you mean changing the behaviour of the sessions. Yes 1 possible reason is if you do not want to issue cookies.
Again if the user has cookies disabled and your server doesnt have session.use_trans_sid enabled the user will not be able to traverse your site properly if it relies on sessions.
06-03-2006, 11:34 AM
· #15 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
how would I get round that?
I am hosted with an external hosting company... do you think that use_trans_sid would be enabled? Is there any reason that they would turn it off?
Thanks
Tom
06-04-2006, 01:42 AM
· #16 NamePros Staff
Name: Peter
Location: Scotland
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (
Donate )
easiest way to find out is to create a phpinfo page:-
the chances are it is already enabled as there is no reason for a host to disable it and would cause alot of problems if they did.
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off