I've been searching about making a lunch box. From what I searched, food is usually safe for up to 2 hours after it was taken from the fridge (pasta, hardboiled egg, etc).  However, if commuting takes 2 hours and the place I'm going doesn't have a fridge, which foods could I bring and make sure they're still fine to eat?  Maybe I'm wrong, but I think most people leave their lunch boxes for more than 2 hours before they can get to eat them. Is it still fine to eat?  I also read that eggs especially shouldn't be eaten after 2 hours, However, I've seen a lot of students, incl. me eat egg sandwiches 2 hours later. Is this a written rule that nobody follows?  I was planning on making some cold pasta with cucumber, cherry tomatoes, hardboiled egg (?), carrot, pickles and some fruit on the side, but now I'm not sure whether it is safe to bring and eat after ~4-5 hours. 
There are a lot of salads that will store well in an insulated bag and an ice-pack. If you store the dressing separately, you'll keep everything dry and more likely to be fresh when you eat in 3-5 hours, too.   As someone else mentioned, you can easily pick up an insulated bag from Walmart, or other retailers.   You can store protein for your salad, like chicken or turkey, or tofu, in a separate container, or together without dressing, as long as it's with an icepack. The ice pack can allow you to store the foods for a full day, or until the ice completely melts.  