Page 1 of 1
Sessions Cookies - Saving for Domain Path
Posted: Fri Jun 09, 2006 10:09 pm
by tecktalkcm0391
I have my login page located at
http://www.URL.com/Login and inside that folder the session cookie is saved, but how to i make it so that the cookies applys to
http://www.URL.com and any folder after it, or is this done automatically. Also, how do I make a user say logged in, even after they exit the browser?
Posted: Fri Jun 09, 2006 10:47 pm
by hawleyjr
Have you looked at manual?
http://us3.php.net/manual/en/function.setcookie.php
path
The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain. If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.
domain
The domain that the cookie is available. To make the cookie available on all subdomains of example.com then you'd set it to '.example.com'. The . is not required but makes it compatible with more browsers. Setting it to
http://www.example.com will make the cookie only available in the www subdomain. Refer to tail matching in the spec for details.
Posted: Sat Jun 10, 2006 8:44 am
by Roja
Why do you keep opening TWO threads for ONE topic?
viewtopic.php?p=271331
Posted: Sat Jun 10, 2006 9:31 am
by tecktalkcm0391
Sorry I forgot about that one! But this is asking just a part of what wa in the other one.
Posted: Sat Jun 10, 2006 12:50 pm
by Roja
tecktalkcm0391 wrote:Sorry I forgot about that one! But this is asking just a part of what wa in the other one.
The other thread covers this, so stick to that thread. This is the second set of threads where you've done so - in violation of the forum rules. Try to "remember" better.
Posted: Sat Jun 10, 2006 1:59 pm
by hawleyjr
Locked.