Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: text/html; charset=UTF-8');
- $main_domain = $_SERVER["HTTP_HOST"];
- $expld = explode('.', $main_domain);
- if(count($expld) > 2) {
- $tld = array_pop($expld);
- $domain = array_pop($expld);
- $main_domain = $domain . "." . $tld;
- }
- $main_domain = ".localhost";
- session_name('sid');
- session_set_cookie_params (0, '/', $main_domain);
- session_start();
- echo session_id();
- exit;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement