2008-01-04

How to share PHP session between domain and it's subdomains?

Today I met following task: to share one session between two sites - one site is subdomain of another. Solutions appeared quite simple just need to call session_set_cookie_params ON BOTH sites before call session_start. There is a quick example:

<? session_set_cookie_params ( time()+60*60,'/', '.myhost.com'); session_start(); ?> <html> <head></head> <body> <?php if (!isset($_SESSION['ses_test'])){ $_SESSION['ses_test'] = 1; } print 'Value is: '.($_SESSION['ses_test']++); ?> </body> </html>
 

Оставить комментарий

 
  2007-12-16

HTML to CSS: Remove the gaps between cells (cellpadding, cellspacing)

border-collapse: collapse; If you want to remove all cell padding from all tables on a page, do this: table { border-collapse: collapse; }
 

Оставить комментарий

 
  2007-10-31

Changes on site

Finally improved the process of blog writing. Created authentication for site and added form for blog submitting. Now writing the blog became much more simpler then was before - I was writing them in phpMyAdmin so it was not very pleasant to create new entries. So I am promising that I will write here every day.
 

Оставить комментарий

 
  2007-10-17

English version of site

Finally fixed all weird things on my English version of site. Honestly to say the main purpose of this site was to create English version, but since my native language is Russian this was simpler to prepare Russian first.
 

Оставить комментарий