[PHP] Another questions about usning session.

2003-03-12 Thread André Cupini
* People, sorry my ugly English. I´m Brazilian...

I am looking for learning more about sessions... I´m test this code below
don´t work with me My php version is 4.1.2.
Anybody have a complete example code of how use sessions?
Another doubt: Sessions use cookies? What the advantage in use sessions
instead of cookies?

André Cupini
Programador
[EMAIL PROTECTED]
NeoBiz - fábrica de internet
http://www.neobiz.com.br


Definitely.

- enable cookies on your browser
- make sure you're using PHP = 4.1

1. Start with a blank text file.

2. Copy and paste this in:
---
?php
session_start();
if (!isset($_SESSION['count'])) {
$_SESSION['count'];
}
else {
$_SESSION['count']++;
}
?
Hello visitor, you have seen this page ?php echo $_SESSION['count'] ?
times.p
To continue, A HREF=?php echo $_SERVER['PHP_SELF']; ?click here/A
---

3. Open it up in your browser, and test that it works (the value of
$_SESSION['count'] should increase with each click)

4. If that much works, open up the URL in a second window, and try to run
two separate sessions... (the first window might be on 10 clicks, and the
new one will be starting from 1)

5. If we're still cool, now try it without cookies maybe, by adding the SID
to the URL that they click on.


If all this works, then the problem is obviously in your code somewhere, not
an issue with PHP/sessions/browsers/cookies/etc.


Justin



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


Re: [PHP] Another questions about usning session.

2003-03-12 Thread Marek Kilimajer
Advantage of session is that you can trust the variables you keep in 
your session. cookies can be spoofed

André Cupini wrote:

* People, sorry my ugly English. I´m Brazilian...

I am looking for learning more about sessions... I´m test this code below
don´t work with me My php version is 4.1.2.
Anybody have a complete example code of how use sessions?
Another doubt: Sessions use cookies? What the advantage in use sessions
instead of cookies?
André Cupini
Programador
[EMAIL PROTECTED]
NeoBiz - fábrica de internet
http://www.neobiz.com.br

Definitely.
- enable cookies on your browser
- make sure you're using PHP = 4.1
1. Start with a blank text file.

2. Copy and paste this in:
---
?php
session_start();
if (!isset($_SESSION['count'])) {
   $_SESSION['count'];
}
else {
   $_SESSION['count']++;
}
?
Hello visitor, you have seen this page ?php echo $_SESSION['count'] ?
times.p
To continue, A HREF=?php echo $_SERVER['PHP_SELF']; ?click here/A
---
3. Open it up in your browser, and test that it works (the value of
$_SESSION['count'] should increase with each click)
4. If that much works, open up the URL in a second window, and try to run
two separate sessions... (the first window might be on 10 clicks, and the
new one will be starting from 1)
5. If we're still cool, now try it without cookies maybe, by adding the SID
to the URL that they click on.
If all this works, then the problem is obviously in your code somewhere, not
an issue with PHP/sessions/browsers/cookies/etc.
Justin



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



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


Re: [PHP] Another questions about usning session.

2003-03-12 Thread Ray Hunter
But also note that session data can be stolen by other users too...

--
Ray

On Wed, 2003-03-12 at 10:10, Marek Kilimajer wrote:
 Advantage of session is that you can trust the variables you keep in 
 your session. cookies can be spoofed
 
 André Cupini wrote:
 
 * People, sorry my ugly English. I´m Brazilian...
 
 I am looking for learning more about sessions... I´m test this code below
 don´t work with me My php version is 4.1.2.
 Anybody have a complete example code of how use sessions?
 Another doubt: Sessions use cookies? What the advantage in use sessions
 instead of cookies?
 
 André Cupini
 Programador
 [EMAIL PROTECTED]
 NeoBiz - fábrica de internet
 http://www.neobiz.com.br
 
 
 Definitely.
 
 - enable cookies on your browser
 - make sure you're using PHP = 4.1
 
 1. Start with a blank text file.
 
 2. Copy and paste this in:
 ---
 ?php
 session_start();
 if (!isset($_SESSION['count'])) {
 $_SESSION['count'];
 }
 else {
 $_SESSION['count']++;
 }
 ?
 Hello visitor, you have seen this page ?php echo $_SESSION['count'] ?
 times.p
 To continue, A HREF=?php echo $_SERVER['PHP_SELF']; ?click here/A
 ---
 
 3. Open it up in your browser, and test that it works (the value of
 $_SESSION['count'] should increase with each click)
 
 4. If that much works, open up the URL in a second window, and try to run
 two separate sessions... (the first window might be on 10 clicks, and the
 new one will be starting from 1)
 
 5. If we're still cool, now try it without cookies maybe, by adding the SID
 to the URL that they click on.
 
 
 If all this works, then the problem is obviously in your code somewhere, not
 an issue with PHP/sessions/browsers/cookies/etc.
 
 
 Justin
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
   
 
 


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



Re: [PHP] Another questions about usning session.

2003-03-12 Thread André Cupini
I´m beginning in this list but already see that she´s better that any other.
Thanks for all! My doubt is clarified.

André Cupini
Programador
[EMAIL PROTECTED]
NeoBiz - fábrica de internet
http://www.neobiz.com.br

  - Original Message - 
  From: Ray Hunter 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, March 12, 2003 2:13 PM
  Subject: Re: [PHP] Another questions about usning session.


  But also note that session data can be stolen by other users too...

  --
  Ray

  On Wed, 2003-03-12 at 10:10, Marek Kilimajer wrote:
   Advantage of session is that you can trust the variables you keep in 
   your session. cookies can be spoofed
   
   André Cupini wrote:
   
   * People, sorry my ugly English. I´m Brazilian...
   
   I am looking for learning more about sessions... I´m test this code below
   don´t work with me My php version is 4.1.2.
   Anybody have a complete example code of how use sessions?
   Another doubt: Sessions use cookies? What the advantage in use sessions
   instead of cookies?
   
   André Cupini
   Programador
   [EMAIL PROTECTED]
   NeoBiz - fábrica de internet
   http://www.neobiz.com.br
   
   
   Definitely.
   
   - enable cookies on your browser
   - make sure you're using PHP = 4.1
   
   1. Start with a blank text file.
   
   2. Copy and paste this in:
   ---
   ?php
   session_start();
   if (!isset($_SESSION['count'])) {
   $_SESSION['count'];
   }
   else {
   $_SESSION['count']++;
   }
   ?
   Hello visitor, you have seen this page ?php echo $_SESSION['count'] ?
   times.p
   To continue, A HREF=?php echo $_SERVER['PHP_SELF']; ?click here/A
   ---
   
   3. Open it up in your browser, and test that it works (the value of
   $_SESSION['count'] should increase with each click)
   
   4. If that much works, open up the URL in a second window, and try to run
   two separate sessions... (the first window might be on 10 clicks, and the
   new one will be starting from 1)
   
   5. If we're still cool, now try it without cookies maybe, by adding the SID
   to the URL that they click on.
   
   
   If all this works, then the problem is obviously in your code somewhere, not
   an issue with PHP/sessions/browsers/cookies/etc.
   
   
   Justin
   
   
   
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
   
 
   
   


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

[PHP] Sessions Tutorial [was: Re: [PHP] Another questions about usning session.]

2003-03-12 Thread Tom Woody
I have found this to the best tutorial I have seen yet on sessions...its
very straight forward, and took care of a lot of questions that I had.

http://www.sitepoint.com/article/319/95

snip snip
-- 
Tom Woody
Systems Administrator

Don't throw your computer out the window, 
throw the Windows out of your computer! 


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