Sessions Cookies - Saving for Domain Path
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Sessions Cookies - Saving for Domain Path
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?
Have you looked at manual?
http://us3.php.net/manual/en/function.setcookie.php
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.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida