[advanced search]
Results from the most recent live auction are here.
20 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 06-01-2006, 02:42 PM   · #1
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
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


Please register or log-in into NamePros to hide ads
PoorDoggie is offline   Reply With Quote
Old 06-01-2006, 02:51 PM   · #2
iNod
Eating Pie
 
iNod's Avatar
 
Name: Steve
Location: Canada
Trader Rating: (66)
Join Date: Nov 2004
Posts: 2,284
NP$: 91.30 (Donate)
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
Hello,

You only need to really use it if you plan on calling a $_SESSION['variable'] to get what the session contains.

- Steve
__________________
RegisterDub.com - 200th Customer Milestone
ZuneParts.net - International Zune Parts and Accessories
FeaturedFont.com - One Top Free Font a Day!
iNod is offline   Reply With Quote
Old 06-01-2006, 02:52 PM   · #3
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
thanks - its not going to forget that variable if I don't use it though?
PoorDoggie is offline   Reply With Quote
Old 06-01-2006, 03:38 PM   · #4
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 
Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,268
NP$: 1152.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
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.
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.3 now available!!
SecondVersion is offline   Reply With Quote
Old 06-01-2006, 04:06 PM   · #5
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
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!
PoorDoggie is offline   Reply With Quote
Old 06-02-2006, 12:42 AM   · #6
Peter
NamePros Staff
 
Peter's Avatar
 
Name: Peter
Location: Scotland
Trader Rating: (47)
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (Donate)
Peter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud of
Child Abuse Save The Children Save The Children
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.
Peter is offline   Reply With Quote
Old 06-02-2006, 07:52 AM   · #7
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
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@...???
PoorDoggie is offline   Reply With Quote
Old 06-02-2006, 10:13 AM   · #8
eagle12
NamePros Member
 
Location: Ontario, Canada
Trader Rating: (1)
Join Date: Nov 2003
Posts: 79
NP$: 19.70 (Donate)
eagle12 is on a distinguished road
If you don't put it on the top of all pages, you will probably see some inconsistancies.
eagle12 is offline   Reply With Quote
Old 06-02-2006, 11:17 AM   · #9
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
so you are saying, put it there anyway?
PoorDoggie is offline   Reply With Quote
Old 06-02-2006, 01:28 PM   · #10
Peter
NamePros Staff
 
Peter's Avatar
 
Name: Peter
Location: Scotland
Trader Rating: (47)
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (Donate)
Peter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud of
Child Abuse Save The Children Save The Children
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.
Peter is offline   Reply With Quote
Old 06-02-2006, 03:17 PM   · #11
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
oh right. So there is always a sid?

Thanks
Tom
PoorDoggie is offline   Reply With Quote
Old 06-02-2006, 04:13 PM   · #12
Peter
NamePros Staff
 
Peter's Avatar
 
Name: Peter
Location: Scotland
Trader Rating: (47)
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (Donate)
Peter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud of
Child Abuse Save The Children Save The Children
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()
Peter is offline   Reply With Quote
Old 06-02-2006, 05:07 PM   · #13
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
oh right. Would there be any point doing that though? Would I ever need to use a session id?
PoorDoggie is offline   Reply With Quote
Old 06-03-2006, 03:21 AM   · #14
Peter
NamePros Staff
 
Peter's Avatar
 
Name: Peter
Location: Scotland
Trader Rating: (47)
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (Donate)
Peter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud of
Child Abuse Save The Children Save The Children
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.
Peter is offline   Reply With Quote
Old 06-03-2006, 11:34 AM   · #15
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
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
PoorDoggie is offline   Reply With Quote
Old 06-04-2006, 01:42 AM   · #16
Peter
NamePros Staff
 
Peter's Avatar
 
Name: Peter
Location: Scotland
Trader Rating: (47)
Join Date: Nov 2003
Posts: 4,337
NP$: 2039.40 (Donate)
Peter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud of
Child Abuse Save The Children Save The Children
easiest way to find out is to create a phpinfo page:-

PHP Code:
<?PHP
phpinfo
();
?>


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.
Peter is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Proof is in the Parking Proof is in the Parking Buy Flash Arcade Game Script
Advertise your business at NamePros
All times are GMT -7. The time now is 09:12 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0