Arduino stops working after few hours

Hi, I've a problem with my yùn... After a couple of hours (sometimes earlier too) connected to my USB it suddendly stops working, the code doesn't work anymore, like if it loses the connection with my wifi..
My code is about an html page that control arduino sending commands via buttons or switches in html. When Arduino stops working I can press any button on the page but Arduino doesn't receive anything, that's the problem...
Can anyone give me some help?
thank you!

Please post your code. I'm guessing you have a memory leak or some other error in your sketch that makes it eventually unresponsive.

What browser are you using? I have similar problems with Internet Explorer, but my HTML/JavaScript code works fine in Chrome and Safari.

ShapeShifter:
Please post your code. I'm guessing you have a memory leak or some other error in your sketch that makes it eventually unresponsive.

@ShapeShifter,
Note, webservers have timeouts and if recycling the page solves the problem, that might be the issue.
Jesse

@jverive I'm using chrome

Please put your code on a site like pastebin next time, it makes peoples lives easier.

Or just attach the code to the message if it's too long. If you're going to put the code in the actual post, always put it in code tags (click the button that looks like </> then paste the code between the tags.)

Markup. See image.

arduino_markup.png

Here's the complete code like you wanted guys, please help me:

_24_03_2015_Versione_finale.ino (13.7 KB)