Write with session