Cookies 
Author Message
 Cookies

OK, follow a sucessfull password match I use
// from www.domain.com/login/index.php
setcookie("cookie","$user\t$email",time()+360000,"","");
header("location:../index1.php");

to set the cookie and

// from a template which is called by every page
if($_COOKIE["cookie"]){
echo "You are logged in as " . parse_cookie("name") . " <a
href='logout.php'>[Logout]</a>";}

to display the cookie. Trouble is that the cookie info will only be
displayed if I access it from a page within the login directory and nowhere
else..

Help

TomH



Wed, 22 Jun 2005 03:53:37 GMT  
 Cookies
Set the path/domain of the cookie to include your entire site.  In other
words change the "", "" arguments in your setcookie line.

good luck!


Quote:

>OK, follow a sucessfull password match I use
>// from www.domain.com/login/index.php
>setcookie("cookie","$user\t$email",time()+360000,"","");
>header("location:../index1.php");

>to set the cookie and

>// from a template which is called by every page
>if($_COOKIE["cookie"]){
>echo "You are logged in as " . parse_cookie("name") . " <a
>href='logout.php'>[Logout]</a>";}

>to display the cookie. Trouble is that the cookie info will only be
>displayed if I access it from a page within the login directory and nowhere
>else..

>Help

>TomH



Wed, 22 Jun 2005 04:05:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ANNOUNCE: Cookie.py A module to manage create web cookies

2. Toss your cookies (Mozilla cookie file filter)

3. VisualWorks servlets and cookies

4. Cookies in NAWK

5. Cookies within WebConnection

6. Passing Cookies via httpsocket

7. C55, How to write and read cookie?

8. cookies

9. cookies

10. Deleting Cookies???

11. Accessing info in cookies

12. socket tools http; cookies

 

 
Powered by phpBB® Forum Software