Advertisement
Guest User

Untitled

a guest
Jul 29th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Uri target = new Uri("http://www.steamcommunity.com/");
  2.  
  3. cookieContainer.Add(new Cookie("timezoneOffset", "7200,0") { Domain = target.Host });
  4.  
  5. function setTimezoneCookies()
  6. {
  7. var now = new Date();
  8. var expire = new Date();
  9.  
  10. // One year expiration, this way we don't need to wait at least one page
  11. // load to have accurate timezone info each session, but only each time the user
  12. // comes with cleared cookies
  13. expire.setTime( now.getTime() + 3600000*24*365 );
  14. tzOffset = now.getTimezoneOffset() * -1 * 60;
  15. isDST = 0;
  16. document.cookie = "timezoneOffset=" + tzOffset + "," + isDST + ";expires="+expire.toGMTString() + ";path=/";
  17. }
  18. // We always want to have the timezone cookie set for PHP to use
  19. setTimezoneCookies();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement