[PHP] Re: session id

2003-03-25 Thread Michael Heuser
The function session_start is sending a cookie. This means that you can't
echo anything before. Its the same rules as with setcookie.

Iggy [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 can somebody tell me why I am getting this:
 Warning: session_start() [function.session-start]: Cannot send session
 cookie - headers already sent by (output started at
 c:\inetpub\wwwroot\search.php:8) in c:\inetpub\wwwroot\search.php on line
21

 Warning: session_start() [function.session-start]: Cannot send session
cache
 limiter - headers already sent (output started at
 c:\inetpub\wwwroot\search.php:8) in c:\inetpub\wwwroot\search.php on line
21


 when I use this code:

 session_start();
 if (!isset($_SESSION['count'])) {
 $_SESSION['count'] = 0;
 }


 PHP is version 4.3.1

 thanx





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



[PHP] RE: session id

2003-03-25 Thread Uttam
session_start();
should be on the first line in the script.

regds,

-Original Message-
From: Iggy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 20:08
To: [EMAIL PROTECTED]
Subject: session id


can somebody tell me why I am getting this:
Warning: session_start() [function.session-start]: Cannot send session
cookie - headers already sent by (output started at
c:\inetpub\wwwroot\search.php:8) in c:\inetpub\wwwroot\search.php on
line 21

Warning: session_start() [function.session-start]: Cannot send session
cache
limiter - headers already sent (output started at
c:\inetpub\wwwroot\search.php:8) in c:\inetpub\wwwroot\search.php on
line 21


when I use this code:

session_start();
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
}


PHP is version 4.3.1

thanx




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



[PHP] Re: session ID does not delete itself

2001-10-19 Thread Chris Lee

in php.ini

session.gc_probability= 1   ; percentual probability that the
; 'garbage collection' process is
started
; on every session initialization
session.gc_maxlifetime= 604800  ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process

I have my php.ini set to everytime php is run it looks for session files 7
days (604800 seconds) old, if there are any files at all, there is a 1%
chance php will delete them. this is called garbage collection.

so to simply answer your question: no. they are not deleted when the user
quits their browser. the cookie however can be set to a lifetime of 0, which
means when the browser quits the cookie is considered expired and the
browser on the next launch will delete the cookie.

--

  Chris Lee
  [EMAIL PROTECTED]




Peter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hi,

 I have been experimenting with PHP4 using sessions and one of my books
 says that session ID's are created in the /tmp directory so I take a look
 in there and I find are about 10 sessions that have not been deleted dated
 earliest to about being week old

 ie.  sess_5b30ccebb1d098c37a5e46efd7708fef

 I have been experimenting with user authentication with sessions and just
 plain starting a session when a user accesses the site.

 Well, the site is still experimental and each time I logged myself out.

 But I thought sessions were supposed to wipe themselves out from the /tmp
 directory immediately after leaving the website.

 Appreciate if someone could shed the light on this issue for me.

 Thanks.

 Peter




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Session ID

2001-10-05 Thread Rosen

Sorry,
I can't access php.ini.
It's on server, outside !!!

Thanks,
Rosen


Richard Lynch [EMAIL PROTECTED] wrote in message
046301c14d62$865a8ea0$c801a8c0@Lynchux100">news:046301c14d62$865a8ea0$c801a8c0@Lynchux100...
 Read php.ini

 Not sure you can set it on a site-by-site basis or within Directory in
 httpd.conf or not though.

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Rosen [EMAIL PROTECTED]
 Newsgroups: php.general
 To: [EMAIL PROTECTED]
 Sent: Thursday, October 04, 2001 3:31 AM
 Subject: Session ID


  Hi,
  I'm creating web site with sessions.
  Normally the site uses PHPSESSID to pass session ID to next page.
  I want to use some script whitch use SID to pass session ID.
  Can I set standart (i.e. PHPSESSID ) to use to pass session ID ?
 
  Thanks,
  Rosen
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Session ID

2001-10-04 Thread Richard Lynch

Read php.ini

Not sure you can set it on a site-by-site basis or within Directory in
httpd.conf or not though.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Rosen [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Thursday, October 04, 2001 3:31 AM
Subject: Session ID


 Hi,
 I'm creating web site with sessions.
 Normally the site uses PHPSESSID to pass session ID to next page.
 I want to use some script whitch use SID to pass session ID.
 Can I set standart (i.e. PHPSESSID ) to use to pass session ID ?

 Thanks,
 Rosen




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]