Re: sessioncookies?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Stokes wrote:
Hello,

I have a following line in my code to set a session cookie when user logs in. It works fine.
setcookie("sess_id","$sess_id",0,"/");


Can I store more information to the session cookie? I mean other variables.

what are you trying to do? (do you need the info in the cookie on the client? or does it need to be 'permanent'?

<explicitly-without-sarcasm>
do you know what a php session is? I get the impression you either don't
or that there is some kind of misunderstanding.
</explicitly-without-sarcasm>

if you want to use the native php session functionality then you don't
have to use setcookie(), instead have good look at:

http://php.net/session

and in particular:

http://php.net/session_start

tiny hint: you 'start' the session on each page (maybe an include file would
come in handy) and then make use of the $_SESSION superglobal (which can store
allsorts [but not all**] of types of variables accross requests).


**resources,filehandles,streams,etc

Like I tried it like this with no success.
setcookie("sess_id","$sess_id",$another_variable,0,"/");

Thanks
-Will


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux